Class CockroachDBDatabaseType
- java.lang.Object
-
- migratedb.v1.core.internal.database.base.BaseDatabaseType
-
- migratedb.v1.core.internal.database.cockroachdb.CockroachDBDatabaseType
-
- All Implemented Interfaces:
DatabaseType
public class CockroachDBDatabaseType extends BaseDatabaseType
-
-
Field Summary
-
Fields inherited from class migratedb.v1.core.internal.database.base.BaseDatabaseType
DEFAULT_PRIORITY
-
-
Constructor Summary
Constructors Constructor Description CockroachDBDatabaseType()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DatabasecreateDatabase(Configuration configuration, JdbcConnectionFactory jdbcConnectionFactory)Initializes the Database used by this Database Type.DatabaseExecutionStrategycreateExecutionStrategy(Connection connection)Initializes the DatabaseExecutionStrategy used by this Database Type.BaseParsercreateParser(Configuration configuration, ResourceProvider resourceProvider, ParsingContext parsingContext)Initializes the Parser used by this Database Type.ExecutionTemplatecreateTransactionalExecutionTemplate(Connection connection, boolean rollbackOnException)Initializes the ExecutionTemplate used by this Database Type.StringgetName()intgetNullType()intgetPriority()When identifying database types, the priority with which this type will be used.booleanhandlesDatabaseProductNameAndVersion(String databaseProductName, String databaseProductVersion, Connection connection)Check if this database type handles the connection product name and version.-
Methods inherited from class migratedb.v1.core.internal.database.base.BaseDatabaseType
alterConnectionAsNeeded, createDatabase, createSqlScriptExecutorFactory, createSqlScriptFactory, getSelectVersionOutput, toString
-
-
-
-
Method Detail
-
getName
public String getName()
- Specified by:
getNamein interfaceDatabaseType- Specified by:
getNamein classBaseDatabaseType- Returns:
- The human-readable name for this database.
-
getNullType
public int getNullType()
- Specified by:
getNullTypein interfaceDatabaseType- Specified by:
getNullTypein classBaseDatabaseType- Returns:
- The JDBC type used to represent
nullin prepared statements.
-
getPriority
public int getPriority()
Description copied from class:BaseDatabaseTypeWhen identifying database types, the priority with which this type will be used. High numbers indicate that this type will be used in preference to others.- Specified by:
getPriorityin interfaceDatabaseType- Overrides:
getPriorityin classBaseDatabaseType
-
handlesDatabaseProductNameAndVersion
public boolean handlesDatabaseProductNameAndVersion(String databaseProductName, String databaseProductVersion, Connection connection)
Description copied from interface:DatabaseTypeCheck if this database type handles the connection product name and version. This allows more fine-grained control over which DatabaseType handles which connection. MigrateDB will use the first DatabaseType that returns true for this method.- Parameters:
databaseProductName- The product name returned by the database.databaseProductVersion- The product version returned by the database.connection- The connection used to connect to the database.- Returns:
trueif this handles the product name and version,falseif not.
-
createDatabase
public Database createDatabase(Configuration configuration, JdbcConnectionFactory jdbcConnectionFactory)
Description copied from interface:DatabaseTypeInitializes the Database used by this Database Type.- Specified by:
createDatabasein interfaceDatabaseType- Specified by:
createDatabasein classBaseDatabaseType- Parameters:
configuration- The MigrateDB configuration.jdbcConnectionFactory- The current connection factory.- Returns:
- The Database.
-
createParser
public BaseParser createParser(Configuration configuration, ResourceProvider resourceProvider, ParsingContext parsingContext)
Description copied from interface:DatabaseTypeInitializes the Parser used by this Database Type.- Specified by:
createParserin interfaceDatabaseType- Specified by:
createParserin classBaseDatabaseType- Parameters:
configuration- The MigrateDB configuration.- Returns:
- The Parser.
-
createExecutionStrategy
public DatabaseExecutionStrategy createExecutionStrategy(Connection connection)
Description copied from interface:DatabaseTypeInitializes the DatabaseExecutionStrategy used by this Database Type.- Specified by:
createExecutionStrategyin interfaceDatabaseType- Overrides:
createExecutionStrategyin classBaseDatabaseType- Returns:
- The DatabaseExecutionStrategy.
-
createTransactionalExecutionTemplate
public ExecutionTemplate createTransactionalExecutionTemplate(Connection connection, boolean rollbackOnException)
Description copied from interface:DatabaseTypeInitializes the ExecutionTemplate used by this Database Type.- Specified by:
createTransactionalExecutionTemplatein interfaceDatabaseType- Overrides:
createTransactionalExecutionTemplatein classBaseDatabaseType- Returns:
- The ExecutionTemplate.
-
-