Interface Database
-
- All Superinterfaces:
AutoCloseable,Closeable
- All Known Implementing Classes:
BaseDatabase,BigQueryDatabase,CockroachDBDatabase,DB2Database,DerbyDatabase,FirebirdDatabase,H2Database,HSQLDBDatabase,IgniteThinDatabase,InformixDatabase,MariaDBDatabase,MySQLDatabase,OracleDatabase,PostgreSQLDatabase,RedshiftDatabase,SAPHANADatabase,SnowflakeDatabase,SpannerDatabase,SQLiteDatabase,SQLServerDatabase,SybaseASEDatabase,SynapseDatabase,TiDBDatabase,YugabyteDBDatabase
public interface Database extends Closeable
-
-
Method Summary
-
-
-
Method Detail
-
ensureSupported
void ensureSupported()
Ensure MigrateDB supports this version of this database.
-
getVersion
Version getVersion()
- Returns:
- The 'major.minor' version of this database.
-
getDefaultDelimiter
Delimiter getDefaultDelimiter()
-
getCatalog
String getCatalog()
- Returns:
- The name of the database, by default as determined by JDBC.
-
getCurrentUser
String getCurrentUser()
-
supportsDdlTransactions
boolean supportsDdlTransactions()
-
supportsChangingCurrentSchema
boolean supportsChangingCurrentSchema()
-
getBooleanTrue
String getBooleanTrue()
- Returns:
- The representation of the value
truein a boolean column.
-
getBooleanFalse
String getBooleanFalse()
- Returns:
- The representation of the value
falsein a boolean column.
-
quote
String quote(String... identifiers)
Quotes these identifiers for use in SQL queries. Multiple identifiers will be quoted and separated by a dot.
-
catalogIsSchema
boolean catalogIsSchema()
- Returns:
trueif this database uses a catalog to represent a schema, orfalseif a schema is simply a schema.
-
usesSingleSession
boolean usesSingleSession()
- Returns:
- Whether a single session is used for both schema history table management and applying migrations.
-
getJdbcMetaData
DatabaseMetaData getJdbcMetaData()
-
getMainSession
Session getMainSession()
- Returns:
- The main session used to manipulate the schema history.
-
getMigrationSession
Session getMigrationSession()
- Returns:
- The migration session used to apply migrations.
-
getCreateScript
SqlScript getCreateScript(SqlScriptFactory sqlScriptFactory, Table table, boolean baseline)
Retrieves the script used to create the schema history table.- Parameters:
sqlScriptFactory- The factory used to create the SQL script.table- The table to create.baseline- Whether to include the creation of a baseline marker.
-
getInstalledBy
String getInstalledBy()
-
getDatabaseType
DatabaseType getDatabaseType()
-
supportsEmptyMigrationDescription
boolean supportsEmptyMigrationDescription()
-
supportsMultiStatementTransactions
boolean supportsMultiStatementTransactions()
-
close
void close()
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-
-