Package liquibase.database.core
Class CockroachDatabase
java.lang.Object
liquibase.database.AbstractJdbcDatabase
liquibase.database.core.AbstractPostgresDatabase
liquibase.database.core.PostgresDatabase
liquibase.database.core.CockroachDatabase
- All Implemented Interfaces:
AutoCloseable,Database,PrioritizedService
-
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_NAMESFields inherited from class liquibase.database.AbstractJdbcDatabase
caseSensitive, currentDateTimeFunction, dateFunctions, defaultAutoIncrementBy, defaultAutoIncrementStartWith, defaultCatalogName, defaultSchemaName, quotingStrategy, sequenceCurrentValueFunction, sequenceNextValueFunction, unmodifiableDataTypes, unquotedObjectsAreUppercasedFields inherited from interface liquibase.database.Database
COMPLETE_SQL_SCOPE_KEY, IGNORE_MISSING_REFERENCES_KEYFields inherited from interface liquibase.servicelocator.PrioritizedService
COMPARATOR, PRIORITY_DATABASE, PRIORITY_DEFAULT -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintintprotected StringintReturns an all-lower-case short name of the product.booleanChecks if the given connection points to a CockroachDB database.voidbooleanThe standard composite-type snapshot generator reads composite types viapg_type/typrelid, which CockroachDB does not populate for user-defined composite types, so it must not be treated as real PostgreSQL for composite-type snapshotting.booleansupportsCreateIfNotExists(Class<? extends DatabaseObject> type) Does the database support the "if not exits" syntax?booleanDetermines if the database supports DDL within a transaction or not.booleanReturns whether this database support initially deferrable columns.booleanCockroachDB does not expose the stored-logic catalog the standard generators rely on.booleanbooleanMethods inherited from class liquibase.database.core.PostgresDatabase
equals, generateAutoIncrementBy, generateAutoIncrementStartWith, generatePrimaryKeyName, getAutoIncrementClause, getAutoIncrementClause, getDefaultDriver, getMaxFractionalDigitsForTimestamp, hashCode, restoreSearchPath, rollback, saveSearchPath, supportsCheckConstraintSnapshot, supportsDatabaseChangeLogHistory, supportsEnumTypeSnapshot, supportsSequencesMethods inherited from class liquibase.database.core.AbstractPostgresDatabase
correctObjectName, escapeObjectName, getConnectionSchemaNameCallStatement, getDatabaseChangeLogLockTableName, getDatabaseChangeLogTableName, getSchemaAndCatalogCase, getSystemViews, hasMixedCase, isReservedWord, isSystemObject, setDefaultCatalogName, supportsCatalogInObjectName, unescapeDataTypeNameMethods 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, setPreviousAutoCommit, startsWithNumeric, supportsAutoIncrement, supportsBatchUpdates, supportsCatalogs, supportsDropTableCascadeConstraints, supportsForeignKeyDisable, supportsNotNullConstraintNames, supportsPrimaryKeyNames, supportsRestrictForeignKeys, supportsSchemas, tag, toString, unescapeDataTypeString, validateMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface liquibase.database.Database
addCompleteSqlToScope, afterUpdate, checkDatabaseConnection, dropDatabaseObjects, escapeForLike, escapeTablespaceName, failOnDefferable, generateConnectCommandSuccessMessage, getDisplayName, supports, temporarilySetObjectQuotingStrategy
-
Constructor Details
-
CockroachDatabase
public CockroachDatabase()
-
-
Method Details
-
getPriority
public int getPriority()- Specified by:
getPriorityin interfacePrioritizedService- Overrides:
getPriorityin classPostgresDatabase
-
getShortName
Description copied from interface:DatabaseReturns an all-lower-case short name of the product. Used for end-user selecting of database type such as the DBMS precondition.- Specified by:
getShortNamein interfaceDatabase- Overrides:
getShortNamein classPostgresDatabase
-
getDefaultDatabaseProductName
- Overrides:
getDefaultDatabaseProductNamein classPostgresDatabase
-
getDatabaseMajorVersion
- Specified by:
getDatabaseMajorVersionin interfaceDatabase- Overrides:
getDatabaseMajorVersionin classAbstractJdbcDatabase- Throws:
DatabaseException
-
getDatabaseMinorVersion
- Specified by:
getDatabaseMinorVersionin interfaceDatabase- Overrides:
getDatabaseMinorVersionin classAbstractJdbcDatabase- Throws:
DatabaseException
-
isCorrectDatabaseImplementation
Checks if the given connection points to a CockroachDB database.Returns false early if the URL is null (which can happen with some JDBC drivers like IBM Informix), since a null URL cannot match any database type.
- Specified by:
isCorrectDatabaseImplementationin interfaceDatabase- Overrides:
isCorrectDatabaseImplementationin classPostgresDatabase- Parameters:
conn- the database connection to check- Returns:
- true if this is a CockroachDB connection, false otherwise
- Throws:
DatabaseException- if there is an error querying the database
-
getDefaultPort
- Specified by:
getDefaultPortin interfaceDatabase- Overrides:
getDefaultPortin classPostgresDatabase
-
supportsInitiallyDeferrableColumns
public boolean supportsInitiallyDeferrableColumns()Description copied from interface:DatabaseReturns whether this database support initially deferrable columns.- Specified by:
supportsInitiallyDeferrableColumnsin interfaceDatabase- Overrides:
supportsInitiallyDeferrableColumnsin classPostgresDatabase
-
supportsTablespaces
public boolean supportsTablespaces()- Specified by:
supportsTablespacesin interfaceDatabase- Overrides:
supportsTablespacesin classPostgresDatabase
-
supportsDDLInTransaction
public boolean supportsDDLInTransaction()Description copied from class:AbstractJdbcDatabaseDetermines if the database supports DDL within a transaction or not.- Specified by:
supportsDDLInTransactionin interfaceDatabase- Overrides:
supportsDDLInTransactionin classAbstractJdbcDatabase- Returns:
- True if the database supports DDL within a transaction, otherwise false.
-
setConnection
- Specified by:
setConnectionin interfaceDatabase- Overrides:
setConnectionin classPostgresDatabase
-
useSerialDatatypes
public boolean useSerialDatatypes()- Overrides:
useSerialDatatypesin classAbstractPostgresDatabase
-
supportsCreateIfNotExists
Description copied from interface:DatabaseDoes the database support the "if not exits" syntax?- Specified by:
supportsCreateIfNotExistsin interfaceDatabase- Overrides:
supportsCreateIfNotExistsin classPostgresDatabase- Parameters:
type- the DatabaseObject type to be checked.- Returns:
- true if the "if not exists" syntax is supported, false otherwise.
-
supportsCompositeTypeSnapshot
public boolean supportsCompositeTypeSnapshot()The standard composite-type snapshot generator reads composite types viapg_type/typrelid, which CockroachDB does not populate for user-defined composite types, so it must not be treated as real PostgreSQL for composite-type snapshotting. Opts down fromPostgresDatabase.- Overrides:
supportsCompositeTypeSnapshotin classPostgresDatabase- Returns:
- true if composite types on this database are snapshot-able via the standard generator
-
supportsStoredLogicSnapshot
public boolean supportsStoredLogicSnapshot()CockroachDB does not expose the stored-logic catalog the standard generators rely on. Opts down fromPostgresDatabase.- Overrides:
supportsStoredLogicSnapshotin classPostgresDatabase- Returns:
- true if stored logic on this database is snapshot-able via the standard generators
-