liquibase.sdk.database
Class MockDatabase

java.lang.Object
  extended by liquibase.sdk.database.MockDatabase
All Implemented Interfaces:
Database, InternalDatabase, PrioritizedService

public class MockDatabase
extends Object
implements Database, InternalDatabase


Field Summary
 
Fields inherited from interface liquibase.database.Database
databaseChangeLogLockTableName, databaseChangeLogTableName
 
Fields inherited from interface liquibase.servicelocator.PrioritizedService
COMPARATOR, PRIORITY_DATABASE, PRIORITY_DEFAULT
 
Constructor Summary
MockDatabase()
           
 
Method Summary
 boolean acquireLock()
           
 boolean acquireLock(Liquibase liquibase)
           
 void addReservedWords(Collection<String> words)
           
 void close()
           
 void commit()
           
 String convertRequestedSchemaToCatalog(String requestedSchema)
           
 String convertRequestedSchemaToSchema(String requestedSchema)
           
 String correctObjectName(String name, Class<? extends DatabaseObject> objectType)
          Fix the object name to the format the database expects, handling changes in case, etc.
 String correctObjectName(String name, Class<? extends DatabaseObject> objectType, boolean quoteCorrectedName)
           
 CatalogAndSchema correctSchema(CatalogAndSchema schema)
          Returns a new CatalogAndSchema adjusted for this database.
 boolean createsIndexesForForeignKeys()
           
 boolean dataTypeIsNotModifiable(String typeName)
          Types like int4 in postgres cannot have a modifier.
 boolean disableForeignKeyChecks()
           
 boolean doesTagExist(String tag)
           
 void dropDatabaseObjects(CatalogAndSchema schema)
           
 void enableForeignKeyChecks()
           
 boolean equals(DatabaseObject otherObject, Database accordingTo)
           
 String escapeColumnName(String catalogName, String schemaName, String tableName, String columnName)
          Escapes a single column name in a database-dependent manner so reserved words can be used as a column name (i.e.
 String escapeColumnName(String catalogName, String schemaName, String tableName, String columnName, boolean quoteNamesThatMayBeFunctions)
           
 String escapeColumnNameList(String columnNames)
          Escapes a list of column names in a database-dependent manner so reserved words can be used as a column name (i.e.
 String escapeConstraintName(String constraintName)
           
 String escapeDataTypeName(String dataTypeName)
           
 String escapeIndexName(String catalogName, String schemaName, String indexName)
           
 String escapeObjectName(String objectName, Class<? extends DatabaseObject> objectType)
           
 String escapeObjectName(String catalogName, String schemaName, String objectName, Class<? extends DatabaseObject> objectType)
           
 String escapeSequenceName(String catalogName, String schemaName, String sequenceName)
           
 String escapeStringForDatabase(String string)
           
 String escapeTableName(String catalogName, String schemaName, String tableName)
           
 String escapeViewName(String catalogName, String schemaName, String viewName)
           
 void execute(SqlStatement[] statements, List<SqlVisitor> sqlVisitors)
           
 void executeRollbackStatements(Change change, List<SqlVisitor> sqlVisitors)
           
 void executeRollbackStatements(SqlStatement[] statements, List<SqlVisitor> sqlVisitors)
           
 void executeStatements(Change change, DatabaseChangeLog changeLog, List<SqlVisitor> sqlVisitors)
           
 String generateDatabaseFunctionValue(DatabaseFunction databaseFunction)
          Some function names are placeholders that need to be replaced with the specific database value.
 String generatePrimaryKeyName(String tableName)
           
 boolean getAutoCommitMode()
          Auto-commit mode to run in
 String getAutoIncrementClause(BigInteger startWith, BigInteger incrementBy)
           
 SqlStatement getCommitSQL()
           
 String getConcatSql(String... values)
          Returns SQL to concat the passed values.
 DatabaseConnection getConnection()
           
 String getConnectionURL()
           
 String getConnectionUsername()
           
 DatabaseObject[] getContainingObjects()
           
 String getCurrentDateTimeFunction()
          Returns database-specific function for generating the current date/time.
 String getDatabaseChangeLogLockTableName()
           
 String getDatabaseChangeLogTableName()
           
 int getDatabaseMajorVersion()
           
 int getDatabaseMinorVersion()
           
 String getDatabaseProductName()
           
 String getDatabaseProductName(DatabaseConnection conn)
           
 String getDatabaseProductVersion()
           
 int getDataTypeMaxParameters(String dataTypeName)
           
 List<DatabaseFunction> getDateFunctions()
          Returns list of database native date functions
 String getDateLiteral(Date date)
           
 String getDateLiteral(Date defaultDateValue)
           
 String getDateLiteral(String isoDate)
           
 String getDateTimeLiteral(Timestamp timeStamp)
           
 String getDefaultCatalogName()
           
 String getDefaultDriver(String url)
          If this database understands the given url, return the default driver class name.
 Integer getDefaultPort()
           
 CatalogAndSchema getDefaultSchema()
           
 String getDefaultSchemaName()
           
 String getDriverName()
           
 Integer getFetchSize()
           
 String getJdbcCatalogName(CatalogAndSchema schema)
           
 String getJdbcCatalogName(Schema schema)
           
 String getJdbcSchemaName(CatalogAndSchema schema)
           
 String getJdbcSchemaName(Schema schema)
           
 String getLineComment()
           
 String getLiquibaseCatalogName()
           
 String getLiquibaseSchemaName()
           
 String getLiquibaseTablespaceName()
           
 String getName()
           
 ObjectQuotingStrategy getObjectQuotingStrategy()
           
 boolean getOutputDefaultCatalog()
           
 boolean getOutputDefaultSchema()
           
 int getPriority()
           
 RanChangeSet getRanChangeSet(ChangeSet changeSet)
           
 List<RanChangeSet> getRanChangeSetList()
           
 Date getRanDate(ChangeSet changeSet)
           
 ChangeSet.RunStatus getRunStatus(ChangeSet changeSet)
           
 Schema getSchema()
           
 CatalogAndSchema getSchemaFromJdbcInfo(String rawCatalogName, String rawSchemaName)
           
 SqlStatement getSelectChangeLogLockSQL()
           
 String getShortName()
          Returns an all-lower-case short name of the product.
 String getSystemSchema()
           
 String getTimeLiteral(Time time)
           
 String getViewDefinition(CatalogAndSchema schema, String name)
           
 boolean isAutoCommit()
           
 boolean isCaseSensitive()
           
 boolean isCorrectDatabaseImplementation(DatabaseConnection conn)
          Is this AbstractDatabase subclass the correct one to use for the given connection.
 boolean isDefaultCatalog(String catalog)
           
 boolean isDefaultSchema(String catalog, String schema)
           
 boolean isFunction(String string)
           
 boolean isLiquibaseObject(DatabaseObject object)
           
 boolean isReservedWord(String string)
           
 boolean isSafeToRunUpdate()
           
 boolean isSystemObject(DatabaseObject example)
           
 DatabaseChangeLogLock[] listLocks()
           
 void markChangeSetExecStatus(ChangeSet changeSet, ChangeSet.ExecType execType)
           
 Date parseDate(String dateAsString)
           
 void releaseLock()
           
 void removeRanStatus(ChangeSet changeSet)
           
 boolean requiresPassword()
           
 boolean requiresUsername()
           
 void resetInternalState()
           
 void rollback()
           
 void saveRollbackStatement(Change change, List<SqlVisitor> sqlVisitors, Writer writer)
           
 void saveStatements(Change change, List<SqlVisitor> sqlVisitors, Writer writer)
           
 void setAutoCommit(boolean b)
           
 void setCanCacheLiquibaseTableInfo(boolean canCacheLiquibaseTableInfo)
           
 void setCaseSensitive(boolean caseSensitive)
           
 void setConnection(Connection conn)
           
 void setConnection(DatabaseConnection conn)
           
 void setCurrentDateTimeFunction(String function)
           
 void setDatabaseChangeLogLockTableName(String tableName)
          Does nothing
 void setDatabaseChangeLogTableName(String tableName)
          Does nothing
 void setDefaultCatalogName(String catalogName)
           
 void setDefaultSchemaName(String schemaName)
           
 void setLiquibaseCatalogName(String catalogName)
           
 void setLiquibaseSchemaName(String schemaName)
           
 void setLiquibaseTablespaceName(String tablespaceName)
           
 void setObjectQuotingStrategy(ObjectQuotingStrategy quotingStrategy)
           
 void setOutputDefaultCatalog(boolean outputDefaultCatalog)
           
 void setOutputDefaultSchema(boolean outputDefaultSchema)
          Whether the default schema should be included in generated SQL
 void setSupportsCatalogs(boolean supportsCatalogs)
           
 void setSupportsSchemas(boolean supportsSchemas)
           
 void setSupportsSequences(boolean supportsSequences)
           
 boolean supportsAutoIncrement()
           
 boolean supportsCatalogInObjectName()
           
 boolean supportsCatalogInObjectName(Class<? extends DatabaseObject> type)
           
 boolean supportsCatalogs()
           
 boolean supportsDDLInTransaction()
          Determines if the database supports DDL within a transaction or not.
 boolean supportsDropTableCascadeConstraints()
           
 boolean supportsForeignKeyDisable()
           
 boolean supportsInitiallyDeferrableColumns()
          Returns whether this database support initially deferrable columns.
 boolean supportsPrimaryKeyNames()
           
 boolean supportsRestrictForeignKeys()
           
 boolean supportsSchemas()
           
 boolean supportsSequences()
           
 boolean supportsTablespaces()
           
 void tag(String tagString)
           
 String toString()
           
 String unescapeDataTypeName(String dataTypeName)
           
 String unescapeDataTypeString(String dataTypeString)
           
 void updateChecksum(ChangeSet changeSet)
           
 ValidationErrors validate()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MockDatabase

public MockDatabase()
Method Detail

getPriority

public int getPriority()
Specified by:
getPriority in interface PrioritizedService

getSchema

public Schema getSchema()

getName

public String getName()

getDefaultSchema

public CatalogAndSchema getDefaultSchema()
Specified by:
getDefaultSchema in interface Database

getDefaultPort

public Integer getDefaultPort()
Specified by:
getDefaultPort in interface Database

getContainingObjects

public DatabaseObject[] getContainingObjects()

equals

public boolean equals(DatabaseObject otherObject,
                      Database accordingTo)

setCanCacheLiquibaseTableInfo

public void setCanCacheLiquibaseTableInfo(boolean canCacheLiquibaseTableInfo)
Specified by:
setCanCacheLiquibaseTableInfo in interface Database

requiresUsername

public boolean requiresUsername()
Specified by:
requiresUsername in interface Database

requiresPassword

public boolean requiresPassword()
Specified by:
requiresPassword in interface Database

isCorrectDatabaseImplementation

public boolean isCorrectDatabaseImplementation(DatabaseConnection conn)
                                        throws DatabaseException
Description copied from interface: Database
Is this AbstractDatabase subclass the correct one to use for the given connection.

Specified by:
isCorrectDatabaseImplementation in interface Database
Throws:
DatabaseException

getDefaultDriver

public String getDefaultDriver(String url)
Description copied from interface: Database
If this database understands the given url, return the default driver class name. Otherwise return null.

Specified by:
getDefaultDriver in interface Database

getConnection

public DatabaseConnection getConnection()
Specified by:
getConnection in interface Database

setConnection

public void setConnection(Connection conn)

setConnection

public void setConnection(DatabaseConnection conn)
Specified by:
setConnection in interface Database

getAutoCommitMode

public boolean getAutoCommitMode()
Description copied from interface: Database
Auto-commit mode to run in

Specified by:
getAutoCommitMode in interface Database

isAutoCommit

public boolean isAutoCommit()
                     throws DatabaseException
Specified by:
isAutoCommit in interface Database
Throws:
DatabaseException

isCaseSensitive

public boolean isCaseSensitive()
Specified by:
isCaseSensitive in interface Database

setCaseSensitive

public void setCaseSensitive(boolean caseSensitive)

setAutoCommit

public void setAutoCommit(boolean b)
                   throws DatabaseException
Specified by:
setAutoCommit in interface Database
Throws:
DatabaseException

supportsDDLInTransaction

public boolean supportsDDLInTransaction()
Description copied from interface: Database
Determines if the database supports DDL within a transaction or not.

Specified by:
supportsDDLInTransaction in interface Database
Returns:
True if the database supports DDL within a transaction, otherwise false.

getDatabaseProductName

public String getDatabaseProductName()
Specified by:
getDatabaseProductName in interface Database

getDatabaseProductVersion

public String getDatabaseProductVersion()
                                 throws DatabaseException
Specified by:
getDatabaseProductVersion in interface Database
Throws:
DatabaseException

getDatabaseMajorVersion

public int getDatabaseMajorVersion()
                            throws DatabaseException
Specified by:
getDatabaseMajorVersion in interface Database
Throws:
DatabaseException

getDatabaseMinorVersion

public int getDatabaseMinorVersion()
                            throws DatabaseException
Specified by:
getDatabaseMinorVersion in interface Database
Throws:
DatabaseException

getShortName

public String getShortName()
Description copied from interface: Database
Returns an all-lower-case short name of the product. Used for end-user selecting of database type such as the DBMS precondition.

Specified by:
getShortName in interface Database

getDriverName

public String getDriverName()
                     throws DatabaseException
Throws:
DatabaseException

getConnectionURL

public String getConnectionURL()
                        throws DatabaseException
Throws:
DatabaseException

getConnectionUsername

public String getConnectionUsername()
                             throws DatabaseException
Throws:
DatabaseException

getDefaultCatalogName

public String getDefaultCatalogName()
Specified by:
getDefaultCatalogName in interface Database

setDefaultCatalogName

public void setDefaultCatalogName(String catalogName)
                           throws DatabaseException
Specified by:
setDefaultCatalogName in interface Database
Throws:
DatabaseException

getDefaultSchemaName

public String getDefaultSchemaName()
Specified by:
getDefaultSchemaName in interface Database

setDefaultSchemaName

public void setDefaultSchemaName(String schemaName)
                          throws DatabaseException
Specified by:
setDefaultSchemaName in interface Database
Throws:
DatabaseException

supportsInitiallyDeferrableColumns

public boolean supportsInitiallyDeferrableColumns()
Description copied from interface: Database
Returns whether this database support initially deferrable columns.

Specified by:
supportsInitiallyDeferrableColumns in interface Database

supportsSequences

public boolean supportsSequences()
Specified by:
supportsSequences in interface Database

setSupportsSequences

public void setSupportsSequences(boolean supportsSequences)

supportsDropTableCascadeConstraints

public boolean supportsDropTableCascadeConstraints()
Specified by:
supportsDropTableCascadeConstraints in interface Database

supportsAutoIncrement

public boolean supportsAutoIncrement()
Specified by:
supportsAutoIncrement in interface Database

getDateLiteral

public String getDateLiteral(String isoDate)
Specified by:
getDateLiteral in interface Database

getDateLiteral

public String getDateLiteral(Date date)
Specified by:
getDateLiteral in interface Database

getTimeLiteral

public String getTimeLiteral(Time time)
Specified by:
getTimeLiteral in interface Database

getDateTimeLiteral

public String getDateTimeLiteral(Timestamp timeStamp)
Specified by:
getDateTimeLiteral in interface Database

getCurrentDateTimeFunction

public String getCurrentDateTimeFunction()
Description copied from interface: Database
Returns database-specific function for generating the current date/time.

Specified by:
getCurrentDateTimeFunction in interface Database

setCurrentDateTimeFunction

public void setCurrentDateTimeFunction(String function)
Specified by:
setCurrentDateTimeFunction in interface Database

getLineComment

public String getLineComment()
Specified by:
getLineComment in interface Database

getAutoIncrementClause

public String getAutoIncrementClause(BigInteger startWith,
                                     BigInteger incrementBy)
Specified by:
getAutoIncrementClause in interface Database

getCommitSQL

public SqlStatement getCommitSQL()

getDatabaseChangeLogTableName

public String getDatabaseChangeLogTableName()
Specified by:
getDatabaseChangeLogTableName in interface Database
See Also:
Database.getDatabaseChangeLogTableName()

getDatabaseChangeLogLockTableName

public String getDatabaseChangeLogLockTableName()
Specified by:
getDatabaseChangeLogLockTableName in interface Database
See Also:
Database.getDatabaseChangeLogLockTableName()

setDatabaseChangeLogLockTableName

public void setDatabaseChangeLogLockTableName(String tableName)
Does nothing

Specified by:
setDatabaseChangeLogLockTableName in interface Database
See Also:
Database.setDatabaseChangeLogLockTableName(java.lang.String)

setDatabaseChangeLogTableName

public void setDatabaseChangeLogTableName(String tableName)
Does nothing

Specified by:
setDatabaseChangeLogTableName in interface Database
See Also:
Database.setDatabaseChangeLogTableName(java.lang.String)

getConcatSql

public String getConcatSql(String... values)
Description copied from interface: Database
Returns SQL to concat the passed values.

Specified by:
getConcatSql in interface Database

acquireLock

public boolean acquireLock(Liquibase liquibase)
                    throws LockException
Throws:
LockException

releaseLock

public void releaseLock()
                 throws LockException
Throws:
LockException

listLocks

public DatabaseChangeLogLock[] listLocks()
                                  throws LockException
Throws:
LockException

dropDatabaseObjects

public void dropDatabaseObjects(CatalogAndSchema schema)
                         throws DatabaseException
Specified by:
dropDatabaseObjects in interface Database
Throws:
DatabaseException

tag

public void tag(String tagString)
         throws DatabaseException
Specified by:
tag in interface Database
Throws:
DatabaseException

doesTagExist

public boolean doesTagExist(String tag)
                     throws DatabaseException
Specified by:
doesTagExist in interface Database
Throws:
DatabaseException

isSystemObject

public boolean isSystemObject(DatabaseObject example)
Specified by:
isSystemObject in interface Database

isLiquibaseObject

public boolean isLiquibaseObject(DatabaseObject object)
Specified by:
isLiquibaseObject in interface Database

supportsTablespaces

public boolean supportsTablespaces()
Specified by:
supportsTablespaces in interface Database

getViewDefinition

public String getViewDefinition(CatalogAndSchema schema,
                                String name)
                         throws DatabaseException
Specified by:
getViewDefinition in interface Database
Throws:
DatabaseException

getDatabaseProductName

public String getDatabaseProductName(DatabaseConnection conn)
                              throws DatabaseException
Throws:
DatabaseException

getDateLiteral

public String getDateLiteral(Date defaultDateValue)
Specified by:
getDateLiteral in interface Database

escapeTableName

public String escapeTableName(String catalogName,
                              String schemaName,
                              String tableName)
Specified by:
escapeTableName in interface Database

escapeIndexName

public String escapeIndexName(String catalogName,
                              String schemaName,
                              String indexName)
Specified by:
escapeIndexName in interface Database

escapeColumnName

public String escapeColumnName(String catalogName,
                               String schemaName,
                               String tableName,
                               String columnName)
Description copied from interface: Database
Escapes a single column name in a database-dependent manner so reserved words can be used as a column name (i.e. "return").

Specified by:
escapeColumnName in interface Database
columnName - column name
Returns:
escaped column name

escapeColumnName

public String escapeColumnName(String catalogName,
                               String schemaName,
                               String tableName,
                               String columnName,
                               boolean quoteNamesThatMayBeFunctions)
Specified by:
escapeColumnName in interface Database

escapeColumnNameList

public String escapeColumnNameList(String columnNames)
Description copied from interface: Database
Escapes a list of column names in a database-dependent manner so reserved words can be used as a column name (i.e. "return").

Specified by:
escapeColumnNameList in interface Database
Parameters:
columnNames - list of column names
Returns:
escaped column name list

escapeSequenceName

public String escapeSequenceName(String catalogName,
                                 String schemaName,
                                 String sequenceName)
Specified by:
escapeSequenceName in interface Database

convertRequestedSchemaToSchema

public String convertRequestedSchemaToSchema(String requestedSchema)
                                      throws DatabaseException
Throws:
DatabaseException

convertRequestedSchemaToCatalog

public String convertRequestedSchemaToCatalog(String requestedSchema)
                                       throws DatabaseException
Throws:
DatabaseException

supportsSchemas

public boolean supportsSchemas()
Specified by:
supportsSchemas in interface Database

setSupportsSchemas

public void setSupportsSchemas(boolean supportsSchemas)

supportsCatalogs

public boolean supportsCatalogs()
Specified by:
supportsCatalogs in interface Database

setSupportsCatalogs

public void setSupportsCatalogs(boolean supportsCatalogs)

supportsCatalogInObjectName

public boolean supportsCatalogInObjectName()

generatePrimaryKeyName

public String generatePrimaryKeyName(String tableName)
Specified by:
generatePrimaryKeyName in interface Database

escapeViewName

public String escapeViewName(String catalogName,
                             String schemaName,
                             String viewName)
Specified by:
escapeViewName in interface Database

acquireLock

public boolean acquireLock()
                    throws LockException
Throws:
LockException

getRunStatus

public ChangeSet.RunStatus getRunStatus(ChangeSet changeSet)
                                 throws DatabaseException,
                                        DatabaseHistoryException
Specified by:
getRunStatus in interface Database
Throws:
DatabaseException
DatabaseHistoryException

getRanChangeSet

public RanChangeSet getRanChangeSet(ChangeSet changeSet)
                             throws DatabaseException,
                                    DatabaseHistoryException
Specified by:
getRanChangeSet in interface Database
Throws:
DatabaseException
DatabaseHistoryException

markChangeSetExecStatus

public void markChangeSetExecStatus(ChangeSet changeSet,
                                    ChangeSet.ExecType execType)
                             throws DatabaseException
Specified by:
markChangeSetExecStatus in interface Database
Throws:
DatabaseException

getRanChangeSetList

public List<RanChangeSet> getRanChangeSetList()
                                       throws DatabaseException
Specified by:
getRanChangeSetList in interface Database
Throws:
DatabaseException

getRanDate

public Date getRanDate(ChangeSet changeSet)
                throws DatabaseException,
                       DatabaseHistoryException
Specified by:
getRanDate in interface Database
Throws:
DatabaseException
DatabaseHistoryException

removeRanStatus

public void removeRanStatus(ChangeSet changeSet)
                     throws DatabaseException
Specified by:
removeRanStatus in interface Database
Throws:
DatabaseException

commit

public void commit()
Specified by:
commit in interface Database

rollback

public void rollback()
Specified by:
rollback in interface Database

getSelectChangeLogLockSQL

public SqlStatement getSelectChangeLogLockSQL()
                                       throws DatabaseException
Throws:
DatabaseException

escapeStringForDatabase

public String escapeStringForDatabase(String string)
Specified by:
escapeStringForDatabase in interface Database

close

public void close()
           throws DatabaseException
Specified by:
close in interface Database
Throws:
DatabaseException

supportsRestrictForeignKeys

public boolean supportsRestrictForeignKeys()
Specified by:
supportsRestrictForeignKeys in interface Database

escapeConstraintName

public String escapeConstraintName(String constraintName)
Specified by:
escapeConstraintName in interface Database

isSafeToRunUpdate

public boolean isSafeToRunUpdate()
                          throws DatabaseException
Specified by:
isSafeToRunUpdate in interface Database
Throws:
DatabaseException

escapeObjectName

public String escapeObjectName(String objectName,
                               Class<? extends DatabaseObject> objectType)
Specified by:
escapeObjectName in interface Database

escapeObjectName

public String escapeObjectName(String catalogName,
                               String schemaName,
                               String objectName,
                               Class<? extends DatabaseObject> objectType)
Specified by:
escapeObjectName in interface Database

executeStatements

public void executeStatements(Change change,
                              DatabaseChangeLog changeLog,
                              List<SqlVisitor> sqlVisitors)
                       throws LiquibaseException
Specified by:
executeStatements in interface Database
Throws:
LiquibaseException

execute

public void execute(SqlStatement[] statements,
                    List<SqlVisitor> sqlVisitors)
             throws LiquibaseException
Specified by:
execute in interface Database
Throws:
LiquibaseException

saveStatements

public void saveStatements(Change change,
                           List<SqlVisitor> sqlVisitors,
                           Writer writer)
                    throws IOException,
                           StatementNotSupportedOnDatabaseException,
                           LiquibaseException
Specified by:
saveStatements in interface Database
Throws:
IOException
StatementNotSupportedOnDatabaseException
LiquibaseException

executeRollbackStatements

public void executeRollbackStatements(Change change,
                                      List<SqlVisitor> sqlVisitors)
                               throws LiquibaseException,
                                      RollbackImpossibleException
Specified by:
executeRollbackStatements in interface Database
Throws:
LiquibaseException
RollbackImpossibleException

executeRollbackStatements

public void executeRollbackStatements(SqlStatement[] statements,
                                      List<SqlVisitor> sqlVisitors)
                               throws LiquibaseException,
                                      RollbackImpossibleException
Specified by:
executeRollbackStatements in interface Database
Throws:
LiquibaseException
RollbackImpossibleException

saveRollbackStatement

public void saveRollbackStatement(Change change,
                                  List<SqlVisitor> sqlVisitors,
                                  Writer writer)
                           throws IOException,
                                  RollbackImpossibleException,
                                  StatementNotSupportedOnDatabaseException,
                                  LiquibaseException
Specified by:
saveRollbackStatement in interface Database
Throws:
IOException
RollbackImpossibleException
StatementNotSupportedOnDatabaseException
LiquibaseException

getLiquibaseCatalogName

public String getLiquibaseCatalogName()
Specified by:
getLiquibaseCatalogName in interface Database

setLiquibaseCatalogName

public void setLiquibaseCatalogName(String catalogName)
Specified by:
setLiquibaseCatalogName in interface Database

getLiquibaseSchemaName

public String getLiquibaseSchemaName()
Specified by:
getLiquibaseSchemaName in interface Database

setLiquibaseSchemaName

public void setLiquibaseSchemaName(String schemaName)
Specified by:
setLiquibaseSchemaName in interface Database

getLiquibaseTablespaceName

public String getLiquibaseTablespaceName()
Specified by:
getLiquibaseTablespaceName in interface Database

setLiquibaseTablespaceName

public void setLiquibaseTablespaceName(String tablespaceName)
Specified by:
setLiquibaseTablespaceName in interface Database

parseDate

public Date parseDate(String dateAsString)
               throws DateParseException
Specified by:
parseDate in interface Database
Throws:
DateParseException

getDateFunctions

public List<DatabaseFunction> getDateFunctions()
Description copied from interface: Database
Returns list of database native date functions

Specified by:
getDateFunctions in interface Database

resetInternalState

public void resetInternalState()
Specified by:
resetInternalState in interface Database

supportsForeignKeyDisable

public boolean supportsForeignKeyDisable()
Specified by:
supportsForeignKeyDisable in interface Database

disableForeignKeyChecks

public boolean disableForeignKeyChecks()
                                throws DatabaseException
Specified by:
disableForeignKeyChecks in interface Database
Throws:
DatabaseException

enableForeignKeyChecks

public void enableForeignKeyChecks()
                            throws DatabaseException
Specified by:
enableForeignKeyChecks in interface Database
Throws:
DatabaseException

updateChecksum

public void updateChecksum(ChangeSet changeSet)
                    throws DatabaseException
Throws:
DatabaseException

isReservedWord

public boolean isReservedWord(String string)
Specified by:
isReservedWord in interface Database

correctSchema

public CatalogAndSchema correctSchema(CatalogAndSchema schema)
Description copied from interface: Database
Returns a new CatalogAndSchema adjusted for this database. Examples of adjustments include: fixes for case issues, replacing null schema or catalog names with the default values removing set schema or catalog names if they are not supported

Specified by:
correctSchema in interface Database

correctObjectName

public String correctObjectName(String name,
                                Class<? extends DatabaseObject> objectType)
Description copied from interface: Database
Fix the object name to the format the database expects, handling changes in case, etc.

Specified by:
correctObjectName in interface Database

correctObjectName

public String correctObjectName(String name,
                                Class<? extends DatabaseObject> objectType,
                                boolean quoteCorrectedName)

getFetchSize

public Integer getFetchSize()
Specified by:
getFetchSize in interface Database

isFunction

public boolean isFunction(String string)
Specified by:
isFunction in interface Database

getDataTypeMaxParameters

public int getDataTypeMaxParameters(String dataTypeName)
Specified by:
getDataTypeMaxParameters in interface Database

getSchemaFromJdbcInfo

public CatalogAndSchema getSchemaFromJdbcInfo(String rawCatalogName,
                                              String rawSchemaName)

getJdbcCatalogName

public String getJdbcCatalogName(CatalogAndSchema schema)

getJdbcSchemaName

public String getJdbcSchemaName(CatalogAndSchema schema)

getJdbcCatalogName

public String getJdbcCatalogName(Schema schema)

getJdbcSchemaName

public String getJdbcSchemaName(Schema schema)

dataTypeIsNotModifiable

public boolean dataTypeIsNotModifiable(String typeName)
Description copied from interface: Database
Types like int4 in postgres cannot have a modifier. e.g. int4(10) Checks whether the type is allowed to have a modifier

Specified by:
dataTypeIsNotModifiable in interface Database
Parameters:
typeName - type name
Returns:
Whether data type can have a modifier

generateDatabaseFunctionValue

public String generateDatabaseFunctionValue(DatabaseFunction databaseFunction)
Description copied from interface: Database
Some function names are placeholders that need to be replaced with the specific database value. e.g. nextSequenceValue(sequenceName) should be replaced with NEXT_VAL('sequenceName') for Postgresql

Specified by:
generateDatabaseFunctionValue in interface Database
Parameters:
databaseFunction - database function to check.
Returns:
the string value to use for an update or generate

setObjectQuotingStrategy

public void setObjectQuotingStrategy(ObjectQuotingStrategy quotingStrategy)
Specified by:
setObjectQuotingStrategy in interface Database

getObjectQuotingStrategy

public ObjectQuotingStrategy getObjectQuotingStrategy()
Specified by:
getObjectQuotingStrategy in interface Database

supportsCatalogInObjectName

public boolean supportsCatalogInObjectName(Class<? extends DatabaseObject> type)
Specified by:
supportsCatalogInObjectName in interface Database

createsIndexesForForeignKeys

public boolean createsIndexesForForeignKeys()
Specified by:
createsIndexesForForeignKeys in interface Database

setOutputDefaultSchema

public void setOutputDefaultSchema(boolean outputDefaultSchema)
Description copied from interface: Database
Whether the default schema should be included in generated SQL

Specified by:
setOutputDefaultSchema in interface Database

getOutputDefaultSchema

public boolean getOutputDefaultSchema()
Specified by:
getOutputDefaultSchema in interface Database

getOutputDefaultCatalog

public boolean getOutputDefaultCatalog()
Specified by:
getOutputDefaultCatalog in interface Database

setOutputDefaultCatalog

public void setOutputDefaultCatalog(boolean outputDefaultCatalog)
Specified by:
setOutputDefaultCatalog in interface Database

isDefaultSchema

public boolean isDefaultSchema(String catalog,
                               String schema)
Specified by:
isDefaultSchema in interface Database

isDefaultCatalog

public boolean isDefaultCatalog(String catalog)
Specified by:
isDefaultCatalog in interface Database

supportsPrimaryKeyNames

public boolean supportsPrimaryKeyNames()
Specified by:
supportsPrimaryKeyNames in interface Database

getSystemSchema

public String getSystemSchema()
Specified by:
getSystemSchema in interface Database

addReservedWords

public void addReservedWords(Collection<String> words)
Specified by:
addReservedWords in interface Database

toString

public String toString()
Overrides:
toString in class Object

escapeDataTypeName

public String escapeDataTypeName(String dataTypeName)
Specified by:
escapeDataTypeName in interface Database

unescapeDataTypeName

public String unescapeDataTypeName(String dataTypeName)
Specified by:
unescapeDataTypeName in interface Database

unescapeDataTypeString

public String unescapeDataTypeString(String dataTypeString)
Specified by:
unescapeDataTypeString in interface Database

validate

public ValidationErrors validate()
Specified by:
validate in interface Database


Copyright © 2016 Liquibase.org. All rights reserved.