Class CockroachDBConnection
- java.lang.Object
-
- migratedb.core.internal.database.base.BaseConnection<CockroachDBDatabase>
-
- migratedb.core.internal.database.cockroachdb.CockroachDBConnection
-
- All Implemented Interfaces:
AutoCloseable,Connection<CockroachDBDatabase>
public class CockroachDBConnection extends BaseConnection<CockroachDBDatabase>
-
-
Field Summary
-
Fields inherited from class migratedb.core.internal.database.base.BaseConnection
database, jdbcTemplate, originalSchemaNameOrSearchPath
-
-
Constructor Summary
Constructors Constructor Description CockroachDBConnection(CockroachDBDatabase database, Connection connection)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidchangeCurrentSchemaTo(Schema<?,?> schema)voiddoChangeCurrentSchemaOrSearchPathTo(String schema)Schema<?,?>doGetCurrentSchema()protected StringgetCurrentSchemaNameOrSearchPath()Schema<?,?>getSchema(String name)Retrieves the schema with this name in the database.-
Methods inherited from class migratedb.core.internal.database.base.BaseConnection
close, doRestoreOriginalState, getCurrentSchema, getJdbcConnection, getJdbcTemplate, lock, restoreOriginalState
-
-
-
-
Constructor Detail
-
CockroachDBConnection
public CockroachDBConnection(CockroachDBDatabase database, Connection connection)
-
-
Method Detail
-
getSchema
public Schema<?,?> getSchema(String name)
Description copied from interface:ConnectionRetrieves the schema with this name in the database.
-
doGetCurrentSchema
public Schema<?,?> doGetCurrentSchema() throws SQLException
- Overrides:
doGetCurrentSchemain classBaseConnection<CockroachDBDatabase>- Throws:
SQLException
-
getCurrentSchemaNameOrSearchPath
protected String getCurrentSchemaNameOrSearchPath() throws SQLException
- Specified by:
getCurrentSchemaNameOrSearchPathin classBaseConnection<CockroachDBDatabase>- Throws:
SQLException- when the current schema name or search path could not be retrieved.
-
changeCurrentSchemaTo
public void changeCurrentSchemaTo(Schema<?,?> schema)
- Specified by:
changeCurrentSchemaToin interfaceConnection<CockroachDBDatabase>- Overrides:
changeCurrentSchemaToin classBaseConnection<CockroachDBDatabase>
-
doChangeCurrentSchemaOrSearchPathTo
public void doChangeCurrentSchemaOrSearchPathTo(String schema) throws SQLException
- Overrides:
doChangeCurrentSchemaOrSearchPathToin classBaseConnection<CockroachDBDatabase>- Parameters:
schema- The new current schema for this connection.- Throws:
SQLException- when the current schema could not be set.
-
-