Class BaseDatabaseType
java.lang.Object
migratedb.v1.core.internal.database.base.BaseDatabaseType
- All Implemented Interfaces:
DatabaseType
- Direct Known Subclasses:
BigQueryDatabaseType,CockroachDBDatabaseType,DB2DatabaseType,DerbyDatabaseType,FirebirdDatabaseType,H2DatabaseType,HSQLDBDatabaseType,IgniteThinDatabaseType,InformixDatabaseType,MariaDBDatabaseType,MySQLDatabaseType,OracleDatabaseType,PostgreSQLDatabaseType,RedshiftDatabaseType,SAPHANADatabaseType,SnowflakeDatabaseType,SpannerDatabaseType,SQLiteDatabaseType,SQLServerDatabaseType,SybaseASEJConnectDatabaseType,SybaseASEJTDSDatabaseType,TestContainersDatabaseType
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidalterConnectionAsNeeded(Connection connection, Configuration configuration) Carries out any manipulation on the Connection that is required by MigrateDB's configDatabase<?>createDatabase(Configuration configuration, boolean printInfo, JdbcConnectionFactory jdbcConnectionFactory) Initializes the Database class, and optionally prints some information.abstract Database<?>createDatabase(Configuration configuration, JdbcConnectionFactory jdbcConnectionFactory) Initializes the Database used by this Database Type.createExecutionStrategy(Connection connection) Initializes the DatabaseExecutionStrategy used by this Database Type.abstract BaseParsercreateParser(Configuration configuration, ResourceProvider resourceProvider, ParsingContext parsingContext) Initializes the Parser used by this Database Type.createSqlScriptExecutorFactory(JdbcConnectionFactory jdbcConnectionFactory, CallbackExecutor callbackExecutor) Initializes the SqlScriptExecutorFactory used by this Database Type.createSqlScriptFactory(Configuration configuration, ParsingContext parsingContext) Initializes the SqlScriptFactory used by this Database Type.createTransactionalExecutionTemplate(Connection connection, boolean rollbackOnException) Initializes the ExecutionTemplate used by this Database Type.abstract StringgetName()abstract intintWhen identifying database types, the priority with which this type will be used.static StringgetSelectVersionOutput(Connection connection) Retrieves the version string for a connection as described by SELECT VERSION(), which may differ from the connection metadata.toString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface migratedb.v1.core.api.internal.database.base.DatabaseType
handlesDatabaseProductNameAndVersion
-
Constructor Details
-
BaseDatabaseType
public BaseDatabaseType()
-
-
Method Details
-
getName
- Specified by:
getNamein interfaceDatabaseType- Returns:
- The human-readable name for this database.
-
toString
-
getNullType
public abstract int getNullType()- Specified by:
getNullTypein interfaceDatabaseType- Returns:
- The JDBC type used to represent
nullin prepared statements.
-
getPriority
public int getPriority()When 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
-
createDatabase
public Database<?> createDatabase(Configuration configuration, boolean printInfo, JdbcConnectionFactory jdbcConnectionFactory) Description copied from interface:DatabaseTypeInitializes the Database class, and optionally prints some information.- Specified by:
createDatabasein interfaceDatabaseType- Parameters:
configuration- The MigrateDB configuration.printInfo- Where the DB info should be printed in the logs.jdbcConnectionFactory- The current connection factory.- Returns:
- The appropriate Database class.
-
createDatabase
public abstract Database<?> createDatabase(Configuration configuration, JdbcConnectionFactory jdbcConnectionFactory) Description copied from interface:DatabaseTypeInitializes the Database used by this Database Type.- Specified by:
createDatabasein interfaceDatabaseType- Parameters:
configuration- The MigrateDB configuration.jdbcConnectionFactory- The current connection factory.- Returns:
- The Database.
-
createParser
public abstract BaseParser createParser(Configuration configuration, ResourceProvider resourceProvider, ParsingContext parsingContext) Description copied from interface:DatabaseTypeInitializes the Parser used by this Database Type.- Specified by:
createParserin interfaceDatabaseType- Parameters:
configuration- The MigrateDB configuration.- Returns:
- The Parser.
-
createSqlScriptFactory
public SqlScriptFactory createSqlScriptFactory(Configuration configuration, ParsingContext parsingContext) Description copied from interface:DatabaseTypeInitializes the SqlScriptFactory used by this Database Type.- Specified by:
createSqlScriptFactoryin interfaceDatabaseType- Parameters:
configuration- The MigrateDB configuration.- Returns:
- The SqlScriptFactory.
-
createSqlScriptExecutorFactory
public SqlScriptExecutorFactory createSqlScriptExecutorFactory(JdbcConnectionFactory jdbcConnectionFactory, CallbackExecutor callbackExecutor) Description copied from interface:DatabaseTypeInitializes the SqlScriptExecutorFactory used by this Database Type.- Specified by:
createSqlScriptExecutorFactoryin interfaceDatabaseType- Parameters:
jdbcConnectionFactory- The current connection factory.- Returns:
- The SqlScriptExecutorFactory.
-
createExecutionStrategy
Description copied from interface:DatabaseTypeInitializes the DatabaseExecutionStrategy used by this Database Type.- Specified by:
createExecutionStrategyin interfaceDatabaseType- 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- Returns:
- The ExecutionTemplate.
-
getSelectVersionOutput
Retrieves the version string for a connection as described by SELECT VERSION(), which may differ from the connection metadata. -
alterConnectionAsNeeded
Description copied from interface:DatabaseTypeCarries out any manipulation on the Connection that is required by MigrateDB's config- Specified by:
alterConnectionAsNeededin interfaceDatabaseType- Parameters:
connection- The JDBC connection.configuration- The MigrateDB configuration.
-