Class RedshiftDatabase
- java.lang.Object
-
- migratedb.core.internal.database.base.BaseDatabase<RedshiftConnection>
-
- migratedb.core.internal.database.redshift.RedshiftDatabase
-
- All Implemented Interfaces:
Closeable,AutoCloseable,Database<RedshiftConnection>
public class RedshiftDatabase extends BaseDatabase<RedshiftConnection>
Redshift database.
-
-
Field Summary
-
Fields inherited from class migratedb.core.internal.database.base.BaseDatabase
configuration, databaseType, jdbcConnectionFactory, jdbcMetaData, jdbcTemplate, rawMainJdbcConnection
-
-
Constructor Summary
Constructors Constructor Description RedshiftDatabase(Configuration configuration, JdbcConnectionFactory jdbcConnectionFactory)Creates a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancatalogIsSchema()protected RedshiftConnectiondoGetConnection(Connection connection)Retrieves a MigrateDB Connection for this JDBC connection.protected StringdoGetCurrentUser()StringdoQuote(String identifier)Quotes this identifier for use in SQL queries.voidensureSupported()Ensure MigrateDB supports this version of this database.StringgetBooleanFalse()StringgetBooleanTrue()StringgetEscapedQuote()StringgetRawCreateScript(Table<?,?> table, boolean baseline)booleansupportsChangingCurrentSchema()booleansupportsDdlTransactions()booleanuseSingleConnection()-
Methods inherited from class migratedb.core.internal.database.base.BaseDatabase
cleanPostSchemas, cleanPreSchemas, close, computeVersionDisplayName, determineVersion, doCleanPostSchemas, doCleanPreSchemas, doGetCatalog, ensureDatabaseIsRecentEnough, getAllSchemas, getBaselineStatement, getCatalog, getCloseQuote, getCreateScript, getCurrentUser, getDatabaseType, getDefaultDelimiter, getInsertStatement, getInstalledBy, getJdbcMetaData, getMainConnection, getMigrationConnection, getOpenQuote, getSelectStatement, getVersion, quote, recommendMigrateDbUpgradeIfNecessary, recommendMigrateDbUpgradeIfNecessaryForMajorVersion, supportsEmptyMigrationDescription, supportsMultiStatementTransactions, unQuote
-
-
-
-
Constructor Detail
-
RedshiftDatabase
public RedshiftDatabase(Configuration configuration, JdbcConnectionFactory jdbcConnectionFactory)
Creates a new instance.- Parameters:
configuration- The MigrateDB configuration.
-
-
Method Detail
-
doGetConnection
protected RedshiftConnection doGetConnection(Connection connection)
Description copied from class:BaseDatabaseRetrieves a MigrateDB Connection for this JDBC connection.- Specified by:
doGetConnectionin classBaseDatabase<RedshiftConnection>
-
ensureSupported
public final void ensureSupported()
Description copied from interface:DatabaseEnsure MigrateDB supports this version of this database.
-
doGetCurrentUser
protected String doGetCurrentUser() throws SQLException
- Overrides:
doGetCurrentUserin classBaseDatabase<RedshiftConnection>- Throws:
SQLException
-
supportsDdlTransactions
public boolean supportsDdlTransactions()
-
supportsChangingCurrentSchema
public boolean supportsChangingCurrentSchema()
-
getBooleanTrue
public String getBooleanTrue()
- Returns:
- The representation of the value
truein a boolean column.
-
getBooleanFalse
public String getBooleanFalse()
- Returns:
- The representation of the value
falsein a boolean column.
-
doQuote
public String doQuote(String identifier)
Description copied from class:BaseDatabaseQuotes this identifier for use in SQL queries.- Overrides:
doQuotein classBaseDatabase<RedshiftConnection>
-
getEscapedQuote
public String getEscapedQuote()
- Overrides:
getEscapedQuotein classBaseDatabase<RedshiftConnection>
-
catalogIsSchema
public boolean catalogIsSchema()
- Returns:
trueif this database uses a catalog to represent a schema, orfalseif a schema is simply a schema.
-
useSingleConnection
public boolean useSingleConnection()
- Specified by:
useSingleConnectionin interfaceDatabase<RedshiftConnection>- Overrides:
useSingleConnectionin classBaseDatabase<RedshiftConnection>- Returns:
- Whether to use a single connection for both schema history table management and applying migrations.
-
-