Package liquibase.database
Interface Database
-
- All Superinterfaces:
AutoCloseable,PrioritizedService
- All Known Implementing Classes:
AbstractDb2Database,AbstractJdbcDatabase,CockroachDatabase,DB2Database,Db2zDatabase,DerbyDatabase,EnterpriseDBDatabase,FirebirdDatabase,H2Database,HsqlDatabase,InformixDatabase,Ingres9Database,MariaDBDatabase,MockDatabase,MSSQLDatabase,MySQLDatabase,OracleDatabase,PostgresDatabase,SnowflakeDatabase,SQLiteDatabase,SybaseASADatabase,SybaseDatabase,UnsupportedDatabase
public interface Database extends PrioritizedService, AutoCloseable
Interface that every DBMS supported by this software must implement. Most methods belong into ont of these categories:- Information about the capabilities of the DBMS (e.g. can it work with catalogs? with schemas?)
- changing and manipulating types defined in the SQL standard into native types and vice-versa
- creating strings for use in SQL statements, e.g. literals for dates, time, numerals, etc.
-
-
Field Summary
Fields Modifier and Type Field Description static StringCOMPLETE_SQL_SCOPE_KEYstatic StringdatabaseChangeLogLockTableNamestatic StringdatabaseChangeLogTableName-
Fields inherited from interface liquibase.servicelocator.PrioritizedService
COMPARATOR, PRIORITY_DATABASE, PRIORITY_DEFAULT
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description default voidaddCompleteSqlToScope(String completeSql)voidaddReservedWords(Collection<String> words)default voidafterUpdate()Allows the database to perform actions after an update is finished, i.voidclose()voidcommit()StringcorrectObjectName(String name, Class<? extends DatabaseObject> objectType)Fix the object name to the format the database expects, handling changes in case, etc.CatalogAndSchemacorrectSchema(CatalogAndSchema schema)Deprecated.booleancreatesIndexesForForeignKeys()booleandataTypeIsNotModifiable(String typeName)Types like int4 in postgres cannot have a modifier.booleandisableForeignKeyChecks()booleandoesTagExist(String tag)Deprecated.UseChangeLogHistoryService.tagExists(String)insteadvoiddropDatabaseObjects(CatalogAndSchema schema)Drops all objects in a specified schema.default voiddropDatabaseObjects(CatalogAndSchema schemaToDrop, SnapshotControl snapshotControl)voidenableForeignKeyChecks()StringescapeColumnName(String catalogName, String schemaName, String tableName, String columnName)Escapes a single column name in a database-dependent manner so reserved words can be used as a column name (i.e.StringescapeColumnName(String catalogName, String schemaName, String tableName, String columnName, boolean quoteNamesThatMayBeFunctions)Deprecated.Know if you should quote the name or not, and useescapeColumnName(String, String, String, String)which will quote things that look like functions, or leave it along as you see fit.StringescapeColumnNameList(String columnNames)Escapes a list of column names in a database-dependent manner so reserved words can be used as a column name (i.e.StringescapeConstraintName(String constraintName)StringescapeDataTypeName(String dataTypeName)StringescapeIndexName(String catalogName, String schemaName, String indexName)StringescapeObjectName(String objectName, Class<? extends DatabaseObject> objectType)StringescapeObjectName(String catalogName, String schemaName, String objectName, Class<? extends DatabaseObject> objectType)StringescapeSequenceName(String catalogName, String schemaName, String sequenceName)StringescapeStringForDatabase(String string)StringescapeTableName(String catalogName, String schemaName, String tableName)StringescapeViewName(String catalogName, String schemaName, String viewName)voidexecute(SqlStatement[] statements, List<SqlVisitor> sqlVisitors)voidexecuteRollbackStatements(Change change, List<SqlVisitor> sqlVisitors)voidexecuteRollbackStatements(SqlStatement[] statements, List<SqlVisitor> sqlVisitors)voidexecuteStatements(Change change, DatabaseChangeLog changeLog, List<SqlVisitor> sqlVisitors)default booleanfailOnDefferable()StringgenerateDatabaseFunctionValue(DatabaseFunction databaseFunction)Some function names are placeholders that need to be replaced with the specific database value.StringgeneratePrimaryKeyName(String tableName)booleangetAutoCommitMode()Auto-commit mode to run inStringgetAutoIncrementClause(BigInteger startWith, BigInteger incrementBy, String generationType, Boolean defaultOnNull)Returns database-specific auto-increment DDL clause.StringgetConcatSql(String... values)Returns SQL to concat the passed values.DatabaseConnectiongetConnection()StringgetCurrentDateTimeFunction()Returns database-specific function for generating the current date/time.StringgetDatabaseChangeLogLockTableName()StringgetDatabaseChangeLogTableName()intgetDatabaseMajorVersion()intgetDatabaseMinorVersion()StringgetDatabaseProductName()Returns the name of the database product according to the underlying database.StringgetDatabaseProductVersion()intgetDataTypeMaxParameters(String dataTypeName)List<DatabaseFunction>getDateFunctions()Returns list of database native date functionsStringgetDateLiteral(String isoDate)StringgetDateLiteral(Date date)StringgetDateLiteral(Date defaultDateValue)StringgetDateTimeLiteral(Timestamp timeStamp)StringgetDefaultCatalogName()StringgetDefaultDriver(String url)If this database understands the given url, return the default driver class name.intgetDefaultFractionalDigitsForTimestamp()When a TIMESTAMP column without the parameter "number of fractional digits" is created, what is the default value?IntegergetDefaultPort()IntegergetDefaultScaleForNativeDataType(String nativeDataType)Returns the default precision for a given native data type, e.g.CatalogAndSchemagetDefaultSchema()StringgetDefaultSchemaName()default StringgetDisplayName()IntegergetFetchSize()StringgetLineComment()StringgetLiquibaseCatalogName()StringgetLiquibaseSchemaName()StringgetLiquibaseTablespaceName()intgetMaxFractionalDigitsForTimestamp()Determines the maximum precision (number of fractional digits) for TIMESTAMP columns for the given database.ObjectQuotingStrategygetObjectQuotingStrategy()booleangetOutputDefaultCatalog()booleangetOutputDefaultSchema()Should the schema be included in identifiers even if it is the default schema?RanChangeSetgetRanChangeSet(ChangeSet changeSet)List<RanChangeSet>getRanChangeSetList()Returns the ChangeSets that have been run against the current database.DategetRanDate(ChangeSet changeSet)ChangeSet.RunStatusgetRunStatus(ChangeSet changeSet)Returns the run status for the given ChangeSetCatalogAndSchema.CatalogAndSchemaCasegetSchemaAndCatalogCase()StringgetShortName()Returns an all-lower-case short name of the product.StringgetSystemSchema()StringgetTimeLiteral(Time time)StringgetViewDefinition(CatalogAndSchema schema, String name)booleanisAutoCommit()booleanisCaseSensitive()booleanisCorrectDatabaseImplementation(DatabaseConnection conn)Is this AbstractDatabase subclass the correct one to use for the given connection.booleanisDefaultCatalog(String catalog)If the database supports catalogs, test if a given catalog name equals to the default catalog of the current logged in user.booleanisDefaultSchema(String catalog, String schema)If the database supports schemas, test if a given combination of catalog and schema name equals to the default catalog and schema of the current logged in user.booleanisFunction(String string)booleanisLiquibaseObject(DatabaseObject object)booleanisReservedWord(String string)booleanisSafeToRunUpdate()booleanisSystemObject(DatabaseObject example)voidmarkChangeSetExecStatus(ChangeSet changeSet, ChangeSet.ExecType execType)After the changeset has been ran against the database this method will update the change log table with the information.DateparseDate(String dateAsString)voidremoveRanStatus(ChangeSet changeSet)booleanrequiresExplicitNullForColumns()Does the database require explicit NULL for nullable columns?booleanrequiresPassword()booleanrequiresUsername()voidresetInternalState()voidrollback()voidsaveRollbackStatement(Change change, List<SqlVisitor> sqlVisitors, Writer writer)voidsaveStatements(Change change, List<SqlVisitor> sqlVisitors, Writer writer)voidsetAutoCommit(boolean b)voidsetCanCacheLiquibaseTableInfo(boolean canCacheLiquibaseTableInfo)voidsetConnection(DatabaseConnection conn)voidsetCurrentDateTimeFunction(String function)voidsetDatabaseChangeLogLockTableName(String tableName)Set the table name of the change log lock to the given table namevoidsetDatabaseChangeLogTableName(String tableName)Sets the table name of the change log to the given table name.voidsetDefaultCatalogName(String catalogName)voidsetDefaultSchemaName(String schemaName)voidsetLiquibaseCatalogName(String catalogName)voidsetLiquibaseSchemaName(String schemaName)voidsetLiquibaseTablespaceName(String tablespaceName)voidsetObjectQuotingStrategy(ObjectQuotingStrategy quotingStrategy)voidsetOutputDefaultCatalog(boolean outputDefaultCatalog)voidsetOutputDefaultSchema(boolean outputDefaultSchema)Whether the default schema should be included in generated SQLbooleansupportsAutoIncrement()booleansupportsBatchUpdates()Does the database support batched DML (INSERT/UPDATE/DELETE/MERGE/...) statements sent in a single call to the database?booleansupportsCatalogInObjectName(Class<? extends DatabaseObject> type)booleansupportsCatalogs()default booleansupportsCreateIfNotExists(Class<? extends DatabaseObject> type)Does the database support the "if not exits" syntax?default booleansupportsDatabaseChangeLogHistory()Does the particular database implementation support the database changelog history feature and associated table?booleansupportsDDLInTransaction()Determines if the database supports DDL within a transaction or not.booleansupportsDropTableCascadeConstraints()booleansupportsForeignKeyDisable()booleansupportsInitiallyDeferrableColumns()Returns whether this database support initially deferrable columns.booleansupportsNotNullConstraintNames()Does this database treat NOT NULL as an own kind of CONSTRAINT (in addition of simply being a column property)? This will affect the CONSTRAINT clause SQL generators.booleansupportsPrimaryKeyNames()booleansupportsRestrictForeignKeys()booleansupportsSchemas()booleansupportsSequences()booleansupportsTablespaces()voidtag(String tagString)Deprecated.UseChangeLogHistoryService.tag(String)insteaddefault TempObjectQuotingStrategytemporarilySetObjectQuotingStrategy(ObjectQuotingStrategy objectQuotingStrategy)Temporarily set the database's object quoting strategy.StringunescapeDataTypeName(String dataTypeName)StringunescapeDataTypeString(String dataTypeString)ValidationErrorsvalidate()-
Methods inherited from interface liquibase.servicelocator.PrioritizedService
getPriority
-
-
-
-
Field Detail
-
databaseChangeLogTableName
static final String databaseChangeLogTableName
-
databaseChangeLogLockTableName
static final String databaseChangeLogLockTableName
-
COMPLETE_SQL_SCOPE_KEY
static final String COMPLETE_SQL_SCOPE_KEY
- See Also:
- Constant Field Values
-
-
Method Detail
-
isCorrectDatabaseImplementation
boolean isCorrectDatabaseImplementation(DatabaseConnection conn) throws DatabaseException
Is this AbstractDatabase subclass the correct one to use for the given connection.- Throws:
DatabaseException
-
getDefaultDriver
String getDefaultDriver(String url)
If this database understands the given url, return the default driver class name. Otherwise return null.
-
getConnection
DatabaseConnection getConnection()
-
setConnection
void setConnection(DatabaseConnection conn)
-
requiresUsername
boolean requiresUsername()
-
requiresPassword
boolean requiresPassword()
-
getAutoCommitMode
boolean getAutoCommitMode()
Auto-commit mode to run in
-
supportsDDLInTransaction
boolean supportsDDLInTransaction()
Determines if the database supports DDL within a transaction or not.- Returns:
- True if the database supports DDL within a transaction, otherwise false.
-
getDatabaseProductName
String getDatabaseProductName()
Returns the name of the database product according to the underlying database.
-
getDatabaseProductVersion
String getDatabaseProductVersion() throws DatabaseException
- Throws:
DatabaseException
-
getDatabaseMajorVersion
int getDatabaseMajorVersion() throws DatabaseException- Throws:
DatabaseException
-
getDatabaseMinorVersion
int getDatabaseMinorVersion() throws DatabaseException- Throws:
DatabaseException
-
getShortName
String getShortName()
Returns an all-lower-case short name of the product. Used for end-user selecting of database type such as the DBMS precondition.
-
getDisplayName
default String getDisplayName()
- Returns:
- a properly formatted name of the product. Used for situations where the database is printed to the console. Example: "Snowflake" (note the capitalization)
-
getDefaultCatalogName
String getDefaultCatalogName()
-
setDefaultCatalogName
void setDefaultCatalogName(String catalogName) throws DatabaseException
- Throws:
DatabaseException
-
getDefaultSchemaName
String getDefaultSchemaName()
-
getDefaultScaleForNativeDataType
Integer getDefaultScaleForNativeDataType(String nativeDataType)
Returns the default precision for a given native data type, e.g. "datetime2" for Microsoft SQL Server.- Parameters:
nativeDataType- the name of the native data type (case-insensitive).- Returns:
- The default precision of the native data type, or null if the type is unknown to this database.
-
setDefaultSchemaName
void setDefaultSchemaName(String schemaName) throws DatabaseException
- Throws:
DatabaseException
-
getDefaultPort
Integer getDefaultPort()
-
getFetchSize
Integer getFetchSize()
-
getLiquibaseCatalogName
String getLiquibaseCatalogName()
-
setLiquibaseCatalogName
void setLiquibaseCatalogName(String catalogName)
-
getLiquibaseSchemaName
String getLiquibaseSchemaName()
-
setLiquibaseSchemaName
void setLiquibaseSchemaName(String schemaName)
-
supportsInitiallyDeferrableColumns
boolean supportsInitiallyDeferrableColumns()
Returns whether this database support initially deferrable columns.
-
supportsSequences
boolean supportsSequences()
-
supportsDropTableCascadeConstraints
boolean supportsDropTableCascadeConstraints()
-
supportsAutoIncrement
boolean supportsAutoIncrement()
-
getCurrentDateTimeFunction
String getCurrentDateTimeFunction()
Returns database-specific function for generating the current date/time.
-
setCurrentDateTimeFunction
void setCurrentDateTimeFunction(String function)
-
getLineComment
String getLineComment()
-
getAutoIncrementClause
String getAutoIncrementClause(BigInteger startWith, BigInteger incrementBy, String generationType, Boolean defaultOnNull)
Returns database-specific auto-increment DDL clause.
-
getDatabaseChangeLogTableName
String getDatabaseChangeLogTableName()
-
setDatabaseChangeLogTableName
void setDatabaseChangeLogTableName(String tableName)
Sets the table name of the change log to the given table name.- Parameters:
tableName- the name of the change log table to set
-
getDatabaseChangeLogLockTableName
String getDatabaseChangeLogLockTableName()
-
setDatabaseChangeLogLockTableName
void setDatabaseChangeLogLockTableName(String tableName)
Set the table name of the change log lock to the given table name- Parameters:
tableName-
-
getLiquibaseTablespaceName
String getLiquibaseTablespaceName()
-
setLiquibaseTablespaceName
void setLiquibaseTablespaceName(String tablespaceName)
-
setCanCacheLiquibaseTableInfo
void setCanCacheLiquibaseTableInfo(boolean canCacheLiquibaseTableInfo)
-
dropDatabaseObjects
void dropDatabaseObjects(CatalogAndSchema schema) throws LiquibaseException
Drops all objects in a specified schema.- Parameters:
schema- schema (catalog+)schema to drop- Throws:
LiquibaseException- if any problem occurs
-
dropDatabaseObjects
default void dropDatabaseObjects(CatalogAndSchema schemaToDrop, SnapshotControl snapshotControl) throws LiquibaseException
- Throws:
LiquibaseException
-
addCompleteSqlToScope
default void addCompleteSqlToScope(String completeSql)
-
tag
@Deprecated void tag(String tagString) throws DatabaseException
Deprecated.UseChangeLogHistoryService.tag(String)insteadTags the database changelog with the given string.- Throws:
DatabaseException
-
doesTagExist
@Deprecated boolean doesTagExist(String tag) throws DatabaseException
Deprecated.UseChangeLogHistoryService.tagExists(String)instead- Throws:
DatabaseException
-
isSystemObject
boolean isSystemObject(DatabaseObject example)
-
isLiquibaseObject
boolean isLiquibaseObject(DatabaseObject object)
-
getViewDefinition
String getViewDefinition(CatalogAndSchema schema, String name) throws DatabaseException
- Throws:
DatabaseException
-
escapeObjectName
String escapeObjectName(String catalogName, String schemaName, String objectName, Class<? extends DatabaseObject> objectType)
-
escapeObjectName
String escapeObjectName(String objectName, Class<? extends DatabaseObject> objectType)
-
getMaxFractionalDigitsForTimestamp
int getMaxFractionalDigitsForTimestamp()
Determines the maximum precision (number of fractional digits) for TIMESTAMP columns for the given database. Might not always be able to give an exact answer since, for some DBMS, it depends on the actual software version if fractional digits are supported. A warning should be logged in this case.- Returns:
- the number of allowed fractional digits for TIMESTAMP columns. May return 0.
-
getDefaultFractionalDigitsForTimestamp
int getDefaultFractionalDigitsForTimestamp()
When a TIMESTAMP column without the parameter "number of fractional digits" is created, what is the default value?- Returns:
- The default number of fractional digits for TIMESTAMP columns
-
escapeColumnName
String escapeColumnName(String catalogName, String schemaName, String tableName, String columnName)
Escapes a single column name in a database-dependent manner so reserved words can be used as a column name (i.e. "return").- Parameters:
schemaName-tableName-columnName- column name- Returns:
- escaped column name
-
escapeColumnName
String escapeColumnName(String catalogName, String schemaName, String tableName, String columnName, boolean quoteNamesThatMayBeFunctions)
Deprecated.Know if you should quote the name or not, and useescapeColumnName(String, String, String, String)which will quote things that look like functions, or leave it along as you see fit. Don't rely on this function guessing.Similar toescapeColumnName(String, String, String, String)but allows control over whether function-like names should be left unquoted.
-
escapeColumnNameList
String escapeColumnNameList(String columnNames)
Escapes a list of column names in a database-dependent manner so reserved words can be used as a column name (i.e. "return").- Parameters:
columnNames- list of column names- Returns:
- escaped column name list
-
supportsTablespaces
boolean supportsTablespaces()
-
supportsCatalogs
boolean supportsCatalogs()
-
getSchemaAndCatalogCase
CatalogAndSchema.CatalogAndSchemaCase getSchemaAndCatalogCase()
-
supportsSchemas
boolean supportsSchemas()
-
supportsCatalogInObjectName
boolean supportsCatalogInObjectName(Class<? extends DatabaseObject> type)
-
escapeSequenceName
String escapeSequenceName(String catalogName, String schemaName, String sequenceName)
-
getRunStatus
ChangeSet.RunStatus getRunStatus(ChangeSet changeSet) throws DatabaseException, DatabaseHistoryException
Returns the run status for the given ChangeSet
-
getRanChangeSet
RanChangeSet getRanChangeSet(ChangeSet changeSet) throws DatabaseException, DatabaseHistoryException
-
markChangeSetExecStatus
void markChangeSetExecStatus(ChangeSet changeSet, ChangeSet.ExecType execType) throws DatabaseException
After the changeset has been ran against the database this method will update the change log table with the information.- Throws:
DatabaseException
-
getRanChangeSetList
List<RanChangeSet> getRanChangeSetList() throws DatabaseException
Returns the ChangeSets that have been run against the current database.- Throws:
DatabaseException
-
getRanDate
Date getRanDate(ChangeSet changeSet) throws DatabaseException, DatabaseHistoryException
-
removeRanStatus
void removeRanStatus(ChangeSet changeSet) throws DatabaseException
- Throws:
DatabaseException
-
commit
void commit() throws DatabaseException- Throws:
DatabaseException
-
rollback
void rollback() throws DatabaseException- Throws:
DatabaseException
-
close
void close() throws DatabaseException- Specified by:
closein interfaceAutoCloseable- Throws:
DatabaseException
-
supportsRestrictForeignKeys
boolean supportsRestrictForeignKeys()
-
isAutoCommit
boolean isAutoCommit() throws DatabaseException- Throws:
DatabaseException
-
setAutoCommit
void setAutoCommit(boolean b) throws DatabaseException- Throws:
DatabaseException
-
isSafeToRunUpdate
boolean isSafeToRunUpdate() throws DatabaseException- Throws:
DatabaseException
-
executeStatements
void executeStatements(Change change, DatabaseChangeLog changeLog, List<SqlVisitor> sqlVisitors) throws LiquibaseException
- Throws:
LiquibaseException
-
execute
void execute(SqlStatement[] statements, List<SqlVisitor> sqlVisitors) throws LiquibaseException
- Throws:
LiquibaseException
-
saveStatements
void saveStatements(Change change, List<SqlVisitor> sqlVisitors, Writer writer) throws IOException, LiquibaseException
- Throws:
IOExceptionLiquibaseException
-
executeRollbackStatements
void executeRollbackStatements(Change change, List<SqlVisitor> sqlVisitors) throws LiquibaseException
- Throws:
LiquibaseException
-
executeRollbackStatements
void executeRollbackStatements(SqlStatement[] statements, List<SqlVisitor> sqlVisitors) throws LiquibaseException
- Throws:
LiquibaseException
-
saveRollbackStatement
void saveRollbackStatement(Change change, List<SqlVisitor> sqlVisitors, Writer writer) throws IOException, LiquibaseException
- Throws:
IOExceptionLiquibaseException
-
parseDate
Date parseDate(String dateAsString) throws DateParseException
- Throws:
DateParseException
-
getDateFunctions
List<DatabaseFunction> getDateFunctions()
Returns list of database native date functions
-
resetInternalState
void resetInternalState()
-
supportsForeignKeyDisable
boolean supportsForeignKeyDisable()
-
disableForeignKeyChecks
boolean disableForeignKeyChecks() throws DatabaseException- Throws:
DatabaseException
-
enableForeignKeyChecks
void enableForeignKeyChecks() throws DatabaseException- Throws:
DatabaseException
-
isCaseSensitive
boolean isCaseSensitive()
-
isReservedWord
boolean isReservedWord(String string)
-
correctSchema
CatalogAndSchema correctSchema(CatalogAndSchema schema)
Deprecated.Returns a new CatalogAndSchema adjusted for this database. Examples of adjustments include: fixes for case issues, replacing null schema or catalog names with the default values removing set schema or catalog names if they are not supported
-
correctObjectName
String correctObjectName(String name, Class<? extends DatabaseObject> objectType)
Fix the object name to the format the database expects, handling changes in case, etc.
-
isFunction
boolean isFunction(String string)
-
getDataTypeMaxParameters
int getDataTypeMaxParameters(String dataTypeName)
-
getDefaultSchema
CatalogAndSchema getDefaultSchema()
-
dataTypeIsNotModifiable
boolean dataTypeIsNotModifiable(String typeName)
Types like int4 in postgres cannot have a modifier. e.g. int4(10) Checks whether the type is allowed to have a modifier- Parameters:
typeName- type name- Returns:
- Whether data type can have a modifier
-
generateDatabaseFunctionValue
String generateDatabaseFunctionValue(DatabaseFunction databaseFunction)
Some function names are placeholders that need to be replaced with the specific database value. e.g. nextSequenceValue(sequenceName) should be replaced with NEXT_VAL('sequenceName') for Postgresql- Parameters:
databaseFunction- database function to check.- Returns:
- the string value to use for an update or generate
-
getObjectQuotingStrategy
ObjectQuotingStrategy getObjectQuotingStrategy()
-
setObjectQuotingStrategy
void setObjectQuotingStrategy(ObjectQuotingStrategy quotingStrategy)
-
createsIndexesForForeignKeys
boolean createsIndexesForForeignKeys()
-
getOutputDefaultSchema
boolean getOutputDefaultSchema()
Should the schema be included in identifiers even if it is the default schema?- Returns:
- true (if the schema should be included in every case) or false (omit if default schema)
-
setOutputDefaultSchema
void setOutputDefaultSchema(boolean outputDefaultSchema)
Whether the default schema should be included in generated SQL
-
isDefaultSchema
boolean isDefaultSchema(String catalog, String schema)
If the database supports schemas, test if a given combination of catalog and schema name equals to the default catalog and schema of the current logged in user.- Parameters:
catalog- catalog name to be testedschema- schema name to be tested- Returns:
- if the database supports catalogs: true if it is the default schema, false if not. If it does not support schemas, the behaviour of this method is undefined (please call supportsSchemas first!)
-
isDefaultCatalog
boolean isDefaultCatalog(String catalog)
If the database supports catalogs, test if a given catalog name equals to the default catalog of the current logged in user.- Parameters:
catalog- catalog name to be tested- Returns:
- if the database supports catalogs: true if it is the default catalog, false if not. If it does not support catalogs, the behaviour of this method is undefined (please call supportsCatalog first!)
-
getOutputDefaultCatalog
boolean getOutputDefaultCatalog()
-
setOutputDefaultCatalog
void setOutputDefaultCatalog(boolean outputDefaultCatalog)
-
supportsPrimaryKeyNames
boolean supportsPrimaryKeyNames()
-
supportsNotNullConstraintNames
boolean supportsNotNullConstraintNames()
Does this database treat NOT NULL as an own kind of CONSTRAINT (in addition of simply being a column property)? This will affect the CONSTRAINT clause SQL generators.- Returns:
- true if the database supports naming NOT NULL constraints, false if not.
-
supportsBatchUpdates
boolean supportsBatchUpdates() throws DatabaseExceptionDoes the database support batched DML (INSERT/UPDATE/DELETE/MERGE/...) statements sent in a single call to the database?- Returns:
- true if the database has this capability for all DML statements, false in all other cases
- Throws:
DatabaseException
-
requiresExplicitNullForColumns
boolean requiresExplicitNullForColumns()
Does the database require explicit NULL for nullable columns?- Returns:
- true if the database behaves incorrectly if NULL is not explicitly specified, false if it behaves like any good RDBMS should.
-
getSystemSchema
String getSystemSchema()
-
addReservedWords
void addReservedWords(Collection<String> words)
-
validate
ValidationErrors validate()
-
failOnDefferable
default boolean failOnDefferable()
-
afterUpdate
default void afterUpdate() throws LiquibaseExceptionAllows the database to perform actions after an update is finished, i. e. after the last change of a changelog was applied.- Throws:
LiquibaseException
-
temporarilySetObjectQuotingStrategy
default TempObjectQuotingStrategy temporarilySetObjectQuotingStrategy(ObjectQuotingStrategy objectQuotingStrategy)
Temporarily set the database's object quoting strategy. The caller is responsible for callingTempObjectQuotingStrategy.close()on the returned object to reset the object quoting strategy back to its original setting.- Parameters:
objectQuotingStrategy- the desired quoting strategy- Returns:
- an object that, when closed, will reset the databases object quoting strategy to the original setting
-
supportsCreateIfNotExists
default boolean supportsCreateIfNotExists(Class<? extends DatabaseObject> type)
Does the database support the "if not exits" syntax?- Parameters:
type- the DatabaseObject type to be checked.- Returns:
- true if the "if not exists" syntax is supported, false otherwise.
-
supportsDatabaseChangeLogHistory
default boolean supportsDatabaseChangeLogHistory()
Does the particular database implementation support the database changelog history feature and associated table?- Returns:
- true if supported, false otherwise
-
-