Class PostgreSQLSchema
- java.lang.Object
-
- migratedb.core.internal.database.base.BaseSchema<PostgreSQLDatabase,PostgreSQLTable>
-
- migratedb.core.internal.database.postgresql.PostgreSQLSchema
-
- All Implemented Interfaces:
Schema<PostgreSQLDatabase,PostgreSQLTable>
- Direct Known Subclasses:
YugabyteDBSchema
public class PostgreSQLSchema extends BaseSchema<PostgreSQLDatabase,PostgreSQLTable>
PostgreSQL implementation of Schema.
-
-
Field Summary
-
Fields inherited from class migratedb.core.internal.database.base.BaseSchema
database, jdbcTemplate, name
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedPostgreSQLSchema(JdbcTemplate jdbcTemplate, PostgreSQLDatabase database, String name)Creates a new PostgreSQL schema.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected PostgreSQLTable[]doAllTables()Retrieves all the tables in this schema.protected voiddoClean()Cleans all the objects in this schema.protected voiddoCreate()Creates this schema in the database.protected voiddoDrop()Drops this schema from the database.protected booleandoEmpty()Checks whether this schema is empty.protected booleandoExists()Checks whether this schema exists.Table<?,?>getTable(String tableName)Retrieves the table with this name in this schema.protected Type<?,?>getType(String typeName)Retrieves the type with this name in this schema.-
Methods inherited from class migratedb.core.internal.database.base.BaseSchema
allFunctions, allTables, allTypes, clean, create, doAllFunctions, drop, empty, equals, exists, getFunction, getName, hashCode, toString
-
-
-
-
Constructor Detail
-
PostgreSQLSchema
protected PostgreSQLSchema(JdbcTemplate jdbcTemplate, PostgreSQLDatabase database, String name)
Creates a new PostgreSQL schema.- Parameters:
jdbcTemplate- The Jdbc Template for communicating with the DB.database- The database-specific support.name- The name of the schema.
-
-
Method Detail
-
doExists
protected boolean doExists() throws SQLExceptionDescription copied from class:BaseSchemaChecks whether this schema exists.- Specified by:
doExistsin classBaseSchema<PostgreSQLDatabase,PostgreSQLTable>- Throws:
SQLException- when the check failed.
-
doEmpty
protected boolean doEmpty() throws SQLExceptionDescription copied from class:BaseSchemaChecks whether this schema is empty.- Specified by:
doEmptyin classBaseSchema<PostgreSQLDatabase,PostgreSQLTable>- Throws:
SQLException- when the check failed.
-
doCreate
protected void doCreate() throws SQLExceptionDescription copied from class:BaseSchemaCreates this schema in the database.- Specified by:
doCreatein classBaseSchema<PostgreSQLDatabase,PostgreSQLTable>- Throws:
SQLException- when the creation failed.
-
doDrop
protected void doDrop() throws SQLExceptionDescription copied from class:BaseSchemaDrops this schema from the database.- Specified by:
doDropin classBaseSchema<PostgreSQLDatabase,PostgreSQLTable>- Throws:
SQLException- when the drop failed.
-
doClean
protected void doClean() throws SQLExceptionDescription copied from class:BaseSchemaCleans all the objects in this schema.- Specified by:
doCleanin classBaseSchema<PostgreSQLDatabase,PostgreSQLTable>- Throws:
SQLException- when the clean failed.
-
doAllTables
protected PostgreSQLTable[] doAllTables() throws SQLException
Description copied from class:BaseSchemaRetrieves all the tables in this schema.- Specified by:
doAllTablesin classBaseSchema<PostgreSQLDatabase,PostgreSQLTable>- Throws:
SQLException- when the retrieval failed.
-
getTable
public Table<?,?> getTable(String tableName)
Description copied from interface:SchemaRetrieves the table with this name in this schema.
-
getType
protected Type<?,?> getType(String typeName)
Description copied from class:BaseSchemaRetrieves the type with this name in this schema.- Overrides:
getTypein classBaseSchema<PostgreSQLDatabase,PostgreSQLTable>
-
-