Class PostgreSQLSession
- java.lang.Object
-
- migratedb.v1.core.internal.database.base.BaseSession
-
- migratedb.v1.core.internal.database.postgresql.PostgreSQLSession
-
- All Implemented Interfaces:
AutoCloseable,Session
- Direct Known Subclasses:
YugabyteDBSession
public class PostgreSQLSession extends BaseSession
-
-
Field Summary
-
Fields inherited from class migratedb.v1.core.internal.database.base.BaseSession
jdbcTemplate, originalSchemaNameOrSearchPath
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedPostgreSQLSession(Configuration configuration, PostgreSQLDatabase database, Connection connection)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidchangeCurrentSchemaTo(Schema schema)Sets the current schema, which is the default owner of new database objects.voiddoChangeCurrentSchemaOrSearchPathTo(String schema)SchemadoGetCurrentSchema()protected voiddoRestoreOriginalState()protected StringgetCurrentSchemaNameOrSearchPath()PostgreSQLDatabasegetDatabase()PostgreSQLSchemagetSchema(String name)Retrieves the schema with this name in the database.<T> Tlock(Table table, Callable<T> callable)Locks this table and executes this callable.-
Methods inherited from class migratedb.v1.core.internal.database.base.BaseSession
close, getCurrentSchema, getJdbcConnection, getJdbcTemplate, restoreOriginalState
-
-
-
-
Constructor Detail
-
PostgreSQLSession
protected PostgreSQLSession(Configuration configuration, PostgreSQLDatabase database, Connection connection)
-
-
Method Detail
-
doRestoreOriginalState
protected void doRestoreOriginalState() throws SQLException- Overrides:
doRestoreOriginalStatein classBaseSession- Throws:
SQLException
-
doGetCurrentSchema
public Schema doGetCurrentSchema() throws SQLException
- Overrides:
doGetCurrentSchemain classBaseSession- Throws:
SQLException
-
getCurrentSchemaNameOrSearchPath
protected String getCurrentSchemaNameOrSearchPath() throws SQLException
- Specified by:
getCurrentSchemaNameOrSearchPathin classBaseSession- Throws:
SQLException- when the current schema name or search path could not be retrieved.
-
changeCurrentSchemaTo
public void changeCurrentSchemaTo(Schema schema)
Description copied from interface:SessionSets the current schema, which is the default owner of new database objects. In many databases, the current schema is also used to lookup tables whenever the schema qualifier is omitted.- Specified by:
changeCurrentSchemaToin interfaceSession- Overrides:
changeCurrentSchemaToin classBaseSession
-
doChangeCurrentSchemaOrSearchPathTo
public void doChangeCurrentSchemaOrSearchPathTo(String schema) throws SQLException
- Overrides:
doChangeCurrentSchemaOrSearchPathToin classBaseSession- Parameters:
schema- The new current schema for this connection.- Throws:
SQLException- when the current schema could not be set.
-
getSchema
public PostgreSQLSchema getSchema(String name)
Description copied from interface:SessionRetrieves the schema with this name in the database.
-
getDatabase
public PostgreSQLDatabase getDatabase()
- Overrides:
getDatabasein classBaseSession
-
-