Package liquibase.database.core
Class CockroachDatabase
- java.lang.Object
-
- liquibase.database.AbstractJdbcDatabase
-
- liquibase.database.core.PostgresDatabase
-
- liquibase.database.core.CockroachDatabase
-
- All Implemented Interfaces:
AutoCloseable
,Database
,PrioritizedService
public class CockroachDatabase extends PostgresDatabase
-
-
Field Summary
-
Fields inherited from class liquibase.database.core.PostgresDatabase
MINIMUM_DBMS_MAJOR_VERSION, MINIMUM_DBMS_MINOR_VERSION, PRODUCT_NAME, VALID_AUTO_INCREMENT_COLUMN_TYPE_NAMES
-
Fields inherited from class liquibase.database.AbstractJdbcDatabase
caseSensitive, currentDateTimeFunction, dateFunctions, defaultAutoIncrementBy, defaultAutoIncrementStartWith, defaultCatalogName, defaultSchemaName, quotingStrategy, sequenceCurrentValueFunction, sequenceNextValueFunction, unmodifiableDataTypes, unquotedObjectsAreUppercased
-
Fields inherited from interface liquibase.database.Database
COMPLETE_SQL_SCOPE_KEY
-
Fields inherited from interface liquibase.servicelocator.PrioritizedService
COMPARATOR, PRIORITY_DATABASE, PRIORITY_DEFAULT
-
-
Constructor Summary
Constructors Constructor Description CockroachDatabase()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getDatabaseMajorVersion()
int
getDatabaseMinorVersion()
protected String
getDefaultDatabaseProductName()
Integer
getDefaultPort()
int
getPriority()
String
getShortName()
Returns an all-lower-case short name of the product.boolean
isCorrectDatabaseImplementation(DatabaseConnection conn)
Is this AbstractDatabase subclass the correct one to use for the given connection.void
setConnection(DatabaseConnection conn)
boolean
supportsCreateIfNotExists(Class<? extends DatabaseObject> type)
Does the database support the "if not exits" syntax?boolean
supportsDDLInTransaction()
Determines if the database supports DDL within a transaction or not.boolean
supportsInitiallyDeferrableColumns()
Returns whether this database support initially deferrable columns.boolean
supportsTablespaces()
boolean
useSerialDatatypes()
Should the database use "serial" datatypes vs.-
Methods inherited from class liquibase.database.core.PostgresDatabase
correctObjectName, equals, escapeObjectName, generateAutoIncrementBy, generateAutoIncrementStartWith, generatePrimaryKeyName, getAutoIncrementClause, getAutoIncrementClause, getConnectionSchemaNameCallStatement, getDatabaseChangeLogLockTableName, getDatabaseChangeLogTableName, getDefaultDriver, getMaxFractionalDigitsForTimestamp, getSchemaAndCatalogCase, getSystemViews, hashCode, hasMixedCase, isReservedWord, isSystemObject, rollback, setDefaultCatalogName, supportsCatalogInObjectName, supportsDatabaseChangeLogHistory, supportsSequences, unescapeDataTypeName
-
Methods inherited from class liquibase.database.AbstractJdbcDatabase
addReservedWords, canCreateChangeLogTable, close, commit, correctSchema, correctSchema, createsIndexesForForeignKeys, dataTypeIsNotModifiable, disableForeignKeyChecks, doesTagExist, dropDatabaseObjects, enableForeignKeyChecks, escapeColumnName, escapeColumnName, escapeColumnNameList, escapeConstraintName, escapeDataTypeName, escapeIndexName, escapeObjectName, escapeSequenceName, escapeStringForDatabase, escapeTableName, escapeViewName, execute, executeRollbackStatements, executeRollbackStatements, executeStatements, filterRollbackVisitors, generateDatabaseFunctionValue, get, getAutoCommitMode, getAutoIncrementByClause, getAutoIncrementClause, getAutoIncrementClosing, getAutoIncrementOpening, getAutoIncrementStartWithClause, getConcatSql, getConnection, getConnectionCatalogName, getConnectionSchemaName, getContainingObjects, getCurrentDateTimeFunction, getDatabaseProductName, getDatabaseProductVersion, getDataTypeMaxParameters, getDateFunctions, getDateLiteral, getDateLiteral, getDateLiteral, getDateTimeLiteral, getDefaultCatalogName, getDefaultFractionalDigitsForTimestamp, getDefaultScaleForNativeDataType, getDefaultSchema, getDefaultSchemaName, getFetchSize, getJdbcCatalogName, getJdbcCatalogName, getJdbcSchemaName, getJdbcSchemaName, getLineComment, getLiquibaseCatalogName, getLiquibaseSchemaName, getLiquibaseTablespaceName, getName, getObjectQuotingStrategy, getOutputDefaultCatalog, getOutputDefaultSchema, getQuotingEndCharacter, getQuotingEndReplacement, getQuotingStartCharacter, getRanChangeSet, getRanChangeSetList, getRanDate, getRawDatabaseChangeLogLockTableName, getRawDatabaseChangeLogTableName, getRunStatus, getSchemaFromJdbcInfo, getSystemSchema, getSystemTables, getTimeLiteral, getViewDefinition, isAutoCommit, isCaseSensitive, isCatalogOrSchemaType, isCurrentTimeFunction, isDateOnly, isDateTime, isDefaultCatalog, isDefaultSchema, isFunction, isLiquibaseObject, isSafeToRunUpdate, isSystemView, isTimeOnly, isTimestamp, jdbcCallsCatalogsSchemas, markChangeSetExecStatus, mustQuoteObjectName, parseDate, quoteObject, removeRanStatus, requiresExplicitNullForColumns, requiresPassword, requiresUsername, resetInternalState, saveRollbackStatement, saveStatements, set, setAutoCommit, setCanCacheLiquibaseTableInfo, setCaseSensitive, setCurrentDateTimeFunction, setDatabaseChangeLogLockTableName, setDatabaseChangeLogTableName, setDefaultSchemaName, setLiquibaseCatalogName, setLiquibaseSchemaName, setLiquibaseTablespaceName, setObjectQuotingStrategy, setOutputDefaultCatalog, setOutputDefaultSchema, startsWithNumeric, supportsAutoIncrement, supportsBatchUpdates, supportsCatalogs, supportsDropTableCascadeConstraints, supportsForeignKeyDisable, supportsNotNullConstraintNames, supportsPrimaryKeyNames, supportsRestrictForeignKeys, supportsSchemas, tag, toString, unescapeDataTypeString, validate
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface liquibase.database.Database
addCompleteSqlToScope, afterUpdate, dropDatabaseObjects, failOnDefferable, getDisplayName, temporarilySetObjectQuotingStrategy
-
-
-
-
Method Detail
-
getPriority
public int getPriority()
- Specified by:
getPriority
in interfacePrioritizedService
- Overrides:
getPriority
in classPostgresDatabase
-
getShortName
public String getShortName()
Description copied from interface:Database
Returns an all-lower-case short name of the product. Used for end-user selecting of database type such as the DBMS precondition.- Specified by:
getShortName
in interfaceDatabase
- Overrides:
getShortName
in classPostgresDatabase
-
getDefaultDatabaseProductName
protected String getDefaultDatabaseProductName()
- Overrides:
getDefaultDatabaseProductName
in classPostgresDatabase
-
getDatabaseMajorVersion
public int getDatabaseMajorVersion() throws DatabaseException
- Specified by:
getDatabaseMajorVersion
in interfaceDatabase
- Overrides:
getDatabaseMajorVersion
in classAbstractJdbcDatabase
- Throws:
DatabaseException
-
getDatabaseMinorVersion
public int getDatabaseMinorVersion() throws DatabaseException
- Specified by:
getDatabaseMinorVersion
in interfaceDatabase
- Overrides:
getDatabaseMinorVersion
in classAbstractJdbcDatabase
- Throws:
DatabaseException
-
isCorrectDatabaseImplementation
public boolean isCorrectDatabaseImplementation(DatabaseConnection conn) throws DatabaseException
Description copied from interface:Database
Is this AbstractDatabase subclass the correct one to use for the given connection.- Specified by:
isCorrectDatabaseImplementation
in interfaceDatabase
- Overrides:
isCorrectDatabaseImplementation
in classPostgresDatabase
- Throws:
DatabaseException
-
getDefaultPort
public Integer getDefaultPort()
- Specified by:
getDefaultPort
in interfaceDatabase
- Overrides:
getDefaultPort
in classPostgresDatabase
-
supportsInitiallyDeferrableColumns
public boolean supportsInitiallyDeferrableColumns()
Description copied from interface:Database
Returns whether this database support initially deferrable columns.- Specified by:
supportsInitiallyDeferrableColumns
in interfaceDatabase
- Overrides:
supportsInitiallyDeferrableColumns
in classPostgresDatabase
-
supportsTablespaces
public boolean supportsTablespaces()
- Specified by:
supportsTablespaces
in interfaceDatabase
- Overrides:
supportsTablespaces
in classPostgresDatabase
-
supportsDDLInTransaction
public boolean supportsDDLInTransaction()
Description copied from class:AbstractJdbcDatabase
Determines if the database supports DDL within a transaction or not.- Specified by:
supportsDDLInTransaction
in interfaceDatabase
- Overrides:
supportsDDLInTransaction
in classAbstractJdbcDatabase
- Returns:
- True if the database supports DDL within a transaction, otherwise false.
-
setConnection
public void setConnection(DatabaseConnection conn)
- Specified by:
setConnection
in interfaceDatabase
- Overrides:
setConnection
in classPostgresDatabase
-
useSerialDatatypes
public boolean useSerialDatatypes()
Description copied from class:PostgresDatabase
Should the database use "serial" datatypes vs. "generated by default as identity"- Overrides:
useSerialDatatypes
in classPostgresDatabase
-
supportsCreateIfNotExists
public boolean supportsCreateIfNotExists(Class<? extends DatabaseObject> type)
Description copied from interface:Database
Does the database support the "if not exits" syntax?- Specified by:
supportsCreateIfNotExists
in interfaceDatabase
- Overrides:
supportsCreateIfNotExists
in classPostgresDatabase
- Parameters:
type
- the DatabaseObject type to be checked.- Returns:
- true if the "if not exists" syntax is supported, false otherwise.
-
-