Class SQLServerDatabase
- java.lang.Object
-
- migratedb.v1.core.internal.database.base.BaseDatabase
-
- migratedb.v1.core.internal.database.sqlserver.SQLServerDatabase
-
- All Implemented Interfaces:
Closeable,AutoCloseable,Database
- Direct Known Subclasses:
SynapseDatabase
public class SQLServerDatabase extends BaseDatabase
-
-
Field Summary
-
Fields inherited from class migratedb.v1.core.internal.database.base.BaseDatabase
configuration, databaseType, jdbcConnectionFactory, jdbcTemplate, rawMainJdbcConnection
-
-
Constructor Summary
Constructors Constructor Description SQLServerDatabase(Configuration configuration, JdbcConnectionFactory jdbcConnectionFactory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancatalogIsSchema()protected StringcomputeVersionDisplayName(Version version)Compute the user-friendly display name for this database version.protected StringdoGetCurrentUser()protected SQLServerSessiondoGetSession(Connection connection)Retrieves a MigrateDB session for this JDBC connection.StringdoQuote(String identifier)Quotes this identifier for use in SQL queries.voidensureSupported()Ensure MigrateDB supports this version of this database.StringgetBooleanFalse()StringgetBooleanTrue()StringgetCloseQuote()DelimitergetDefaultDelimiter()StringgetEscapedQuote()SQLServerSessiongetMainSession()StringgetOpenQuote()StringgetRawCreateScript(Table table, boolean baseline)protected booleansupportsAssemblies()booleansupportsChangingCurrentSchema()booleansupportsDdlTransactions()protected booleansupportsPartitions()protected booleansupportsRules()protected booleansupportsSequences()protected booleansupportsSynonyms()protected booleansupportsTriggers()protected booleansupportsTypes()booleanusesSingleSession()-
Methods inherited from class migratedb.v1.core.internal.database.base.BaseDatabase
close, determineVersion, doGetCatalog, ensureDatabaseIsRecentEnough, getAllSchemas, getBaselineStatement, getCatalog, getCreateScript, getCurrentUser, getDatabaseType, getInsertStatement, getInstalledBy, getJdbcMetaData, getMigrationSession, getSelectStatement, getVersion, quote, recommendMigrateDbUpgradeIfNecessary, recommendMigrateDbUpgradeIfNecessaryForMajorVersion, supportsEmptyMigrationDescription, supportsMultiStatementTransactions, unQuote
-
-
-
-
Constructor Detail
-
SQLServerDatabase
public SQLServerDatabase(Configuration configuration, JdbcConnectionFactory jdbcConnectionFactory)
-
-
Method Detail
-
doGetSession
protected SQLServerSession doGetSession(Connection connection)
Description copied from class:BaseDatabaseRetrieves a MigrateDB session for this JDBC connection.- Specified by:
doGetSessionin classBaseDatabase
-
ensureSupported
public final void ensureSupported()
Description copied from interface:DatabaseEnsure MigrateDB supports this version of this database.
-
computeVersionDisplayName
protected String computeVersionDisplayName(Version version)
Description copied from class:BaseDatabaseCompute the user-friendly display name for this database version.- Overrides:
computeVersionDisplayNamein classBaseDatabase
-
getDefaultDelimiter
public Delimiter getDefaultDelimiter()
- Specified by:
getDefaultDelimiterin interfaceDatabase- Overrides:
getDefaultDelimiterin classBaseDatabase
-
doGetCurrentUser
protected String doGetCurrentUser() throws SQLException
- Overrides:
doGetCurrentUserin classBaseDatabase- 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
-
getOpenQuote
public String getOpenQuote()
- Overrides:
getOpenQuotein classBaseDatabase
-
getCloseQuote
public String getCloseQuote()
- Overrides:
getCloseQuotein classBaseDatabase
-
getEscapedQuote
public String getEscapedQuote()
- Overrides:
getEscapedQuotein classBaseDatabase
-
catalogIsSchema
public boolean catalogIsSchema()
- Returns:
trueif this database uses a catalog to represent a schema, orfalseif a schema is simply a schema.
-
usesSingleSession
public boolean usesSingleSession()
- Specified by:
usesSingleSessionin interfaceDatabase- Overrides:
usesSingleSessionin classBaseDatabase- Returns:
- Whether a single session is used for both schema history table management and applying migrations.
-
getMainSession
public SQLServerSession getMainSession()
- Specified by:
getMainSessionin interfaceDatabase- Overrides:
getMainSessionin classBaseDatabase- Returns:
- The main session used to manipulate the schema history.
-
supportsPartitions
protected boolean supportsPartitions()
-
supportsSequences
protected boolean supportsSequences()
-
supportsSynonyms
protected boolean supportsSynonyms()
-
supportsRules
protected boolean supportsRules()
-
supportsTypes
protected boolean supportsTypes()
-
supportsTriggers
protected boolean supportsTriggers()
-
supportsAssemblies
protected boolean supportsAssemblies()
-
-