Top Description Fields Constructors Methods
liquibase.database.core

public Class MockDatabase

extends Object
implements Database, InternalDatabase
Class Inheritance
All Implemented Interfaces
liquibase.database.InternalDatabase, liquibase.database.Database, java.lang.AutoCloseable, liquibase.servicelocator.PrioritizedService
Annotations
@SuppressWarnings:squid:S1186
Imports
liquibase.CatalogAndSchema, .Liquibase, .Scope, liquibase.change.Change, liquibase.changelog.ChangeLogHistoryServiceFactory, .ChangeSet, .DatabaseChangeLog, .RanChangeSet, liquibase.database.*, liquibase.exception.DatabaseException, .DatabaseHistoryException, .ValidationErrors, liquibase.lockservice.DatabaseChangeLogLock, liquibase.sql.visitor.SqlVisitor, liquibase.statement.DatabaseFunction, .SqlStatement, liquibase.structure.DatabaseObject, liquibase.structure.core.Schema, java.io.Writer, java.math.BigInteger, java.sql.Connection, .Time, .Timestamp, java.util.Collection, .Date, .List

A DBMS that effectively does nothing, but it is useful for tests where everything should work in the same way for all databases.

Field Summary

Modifier and TypeField and Description
private boolean
private DatabaseConnection
private String
private String
private String
private static final int
private boolean
private boolean
private boolean
private boolean
private boolean

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public boolean
acquireLock(final Liquibase liquibase)

public boolean
public void
public void
close()

Implements liquibase.database.Database.close.

Closes this resource, relinquishing any underlying resources.

public void
public String
convertRequestedSchemaToCatalog(final String requestedSchema)

public String
convertRequestedSchemaToSchema(final String requestedSchema)

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

Implements liquibase.database.Database.correctObjectName.

Fix the object name to the format the database expects, handling changes in case, etc.

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

public CatalogAndSchema
correctSchema(final CatalogAndSchema schema)

Implements liquibase.database.Database.correctSchema.

Returns a new CatalogAndSchema adjusted for this database.

public boolean
public boolean
dataTypeIsNotModifiable(final String
type name
typeName
)

Implements liquibase.database.Database.dataTypeIsNotModifiable.

Types like int4 in postgres cannot have a modifier.

public boolean
public boolean
public void
dropDatabaseObjects(final CatalogAndSchema
schema (catalog+)schema to drop
schema
)

Implements liquibase.database.Database.dropDatabaseObjects.

Drops all objects in a specified schema.

public void
public boolean
equals(final DatabaseObject otherObject, final Database accordingTo)

public String
escapeColumnName(final String catalogName, final String schemaName, final String tableName, final String
column name
columnName
)

Implements liquibase.database.Database.escapeColumnName.

Escapes a single column name in a database-dependent manner so reserved words can be used as a column name (i.e. "return").

public String
escapeColumnName(String catalogName, String schemaName, String tableName, String columnName, boolean quoteNamesThatMayBeFunctions)

Implements liquibase.database.Database.escapeColumnName.

Similar to escapeColumnName(String, String, String, String) but allows control over whether function-like names should be left unquoted.

public String
escapeColumnNameList(final String
list of column names
columnNames
)

Implements liquibase.database.Database.escapeColumnNameList.

Escapes a list of column names in a database-dependent manner so reserved words can be used as a column name (i.e. "return").

public String
public String
public String
escapeIndexName(final String catalogName, final String schemaName, final String indexName)

Implements liquibase.database.Database.escapeIndexName.

public String
escapeObjectName(final String objectName, final Class<? extends DatabaseObject> objectType)

Implements liquibase.database.Database.escapeObjectName.

public String
escapeObjectName(final String catalogName, final String schemaName, final String objectName, final Class<? extends DatabaseObject> objectType)

Implements liquibase.database.Database.escapeObjectName.

public String
escapeSequenceName(final String catalogName, final String schemaName, final String sequenceName)

Implements liquibase.database.Database.escapeSequenceName.

public String
public String
escapeTableName(final String catalogName, final String schemaName, final String tableName)

Implements liquibase.database.Database.escapeTableName.

public String
escapeViewName(final String catalogName, final String schemaName, final String viewName)

Implements liquibase.database.Database.escapeViewName.

public void
execute(final SqlStatement[] statements, final List<SqlVisitor> sqlVisitors)

Implements liquibase.database.Database.execute.

public void
public void
public void
executeStatements(final Change change, final DatabaseChangeLog changeLog, final List<SqlVisitor> sqlVisitors)

Implements liquibase.database.Database.executeStatements.

public String
generateDatabaseFunctionValue(final DatabaseFunction
database function to check.
databaseFunction
)

Implements liquibase.database.Database.generateDatabaseFunctionValue.

Some function names are placeholders that need to be replaced with the specific database value.

public String
public boolean
getAutoCommitMode()

Implements liquibase.database.Database.getAutoCommitMode.

Auto-commit mode to run in

public String
getAutoIncrementClause(final BigInteger startWith, final BigInteger incrementBy, final String generationType, final Boolean defaultOnNull)

Implements liquibase.database.Database.getAutoIncrementClause.

Returns database-specific auto-increment DDL clause.

public SqlStatement
public String
getConcatSql(final String... values)

Implements liquibase.database.Database.getConcatSql.

Returns SQL to concat the passed values.

public DatabaseConnection
public String
public String
public DatabaseObject[]
public String
getCurrentDateTimeFunction()

Implements liquibase.database.Database.getCurrentDateTimeFunction.

Returns database-specific function for generating the current date/time.

public String
public String
public int
public int
public String
getDatabaseProductName()

Implements liquibase.database.Database.getDatabaseProductName.

Returns the name of the database product according to the underlying database.

public String
public String
public int
public List<DatabaseFunction>
getDateFunctions()

Implements liquibase.database.Database.getDateFunctions.

Returns list of database native date functions

public String
public String
public String
public String
public String
public String
getDefaultDriver(final String url)

Implements liquibase.database.Database.getDefaultDriver.

If this database understands the given url, return the default driver class name.

public int
getDefaultFractionalDigitsForTimestamp()

Implements liquibase.database.Database.getDefaultFractionalDigitsForTimestamp.

When a TIMESTAMP column without the parameter "number of fractional digits" is created, what is the default value?

public Integer
public Integer
getDefaultScaleForNativeDataType(String
the name of the native data type (case-insensitive).
nativeDataType
)

Implements liquibase.database.Database.getDefaultScaleForNativeDataType.

Returns the default precision for a given native data type, e.g. "datetime2" for Microsoft SQL Server.

public CatalogAndSchema
public String
public String
public Integer
public String
public String
getJdbcCatalogName(final Schema schema)

public String
public String
getJdbcSchemaName(final Schema schema)

public String
public String
public String
public String
public int
getMaxFractionalDigitsForTimestamp()

Implements liquibase.database.Database.getMaxFractionalDigitsForTimestamp.

Determines the maximum precision (number of fractional digits) for TIMESTAMP columns for the given database.

public String
public ObjectQuotingStrategy
public boolean
public boolean
getOutputDefaultSchema()

Implements liquibase.database.Database.getOutputDefaultSchema.

Should the schema be included in identifiers even if it is the default schema?

public int
public RanChangeSet
public List<RanChangeSet>
getRanChangeSetList()

Implements liquibase.database.Database.getRanChangeSetList.

Returns the ChangeSets that have been run against the current database.

public Date
public ChangeSet.RunStatus
getRunStatus(final ChangeSet changeSet)

Implements liquibase.database.Database.getRunStatus.

Returns the run status for the given ChangeSet

public Schema
public CatalogAndSchema.CatalogAndSchemaCase
public CatalogAndSchema
getSchemaFromJdbcInfo(final String rawCatalogName, final String rawSchemaName)

public SqlStatement
public String
getShortName()

Implements liquibase.database.Database.getShortName.

Returns an all-lower-case short name of the product.

public String
public String
public String
public boolean
public boolean
public boolean
isCorrectDatabaseImplementation(final DatabaseConnection conn)

Implements liquibase.database.Database.isCorrectDatabaseImplementation.

Is this AbstractDatabase subclass the correct one to use for the given connection.

public boolean
isDefaultCatalog(final String
catalog name to be tested
catalog
)

Implements liquibase.database.Database.isDefaultCatalog.

If the database supports catalogs, test if a given catalog name equals to the default catalog of the current logged in user.

public boolean
isDefaultSchema(final String
catalog name to be tested
catalog
,
final String
schema name to be tested
schema
)

Implements liquibase.database.Database.isDefaultSchema.

If the database supports schemas, test if a given combination of catalog and schema name equals to the default catalog and schema of the current logged in user.

public boolean
public boolean
public boolean
public boolean
public boolean
public DatabaseChangeLogLock[]
public void
markChangeSetExecStatus(final ChangeSet changeSet, final ChangeSet.ExecType execType)

Implements liquibase.database.Database.markChangeSetExecStatus.

After the changeset has been ran against the database this method will update the change log table with the information.

public Date
public void
public void
public boolean
requiresExplicitNullForColumns()

Implements liquibase.database.Database.requiresExplicitNullForColumns.

Does the database require explicit NULL for nullable columns?

public boolean
public boolean
public void
public void
public void
saveRollbackStatement(final Change change, final List<SqlVisitor> sqlVisitors, final Writer writer)

Implements liquibase.database.Database.saveRollbackStatement.

public void
saveStatements(final Change change, final List<SqlVisitor> sqlVisitors, final Writer writer)

Implements liquibase.database.Database.saveStatements.

public void
public void
public void
setCaseSensitive(boolean caseSensitive)

public void
public void
public void
public void
public void
setDatabaseChangeLogTableName(final String
the name of the change log table to set
tableName
)

Implements liquibase.database.Database.setDatabaseChangeLogTableName.

Does nothing

public void
public void
public void
public void
public void
public void
public void
public void
setOutputDefaultSchema(final boolean outputDefaultSchema)

Implements liquibase.database.Database.setOutputDefaultSchema.

Whether the default schema should be included in generated SQL

public void
setSupportsCatalogs(boolean supportsCatalogs)

public void
setSupportsSchemas(boolean supportsSchemas)

public void
setSupportsSequences(boolean supportsSequences)

public boolean
public boolean
supportsBatchUpdates()

Implements liquibase.database.Database.supportsBatchUpdates.

Does the database support batched DML (INSERT/UPDATE/DELETE/MERGE/...) statements sent in a single call to the database?

public boolean
public boolean
public boolean
public boolean
supportsCreateIfNotExists(Class<? extends DatabaseObject>
the DatabaseObject type to be checked.
type
)

Overrides default liquibase.database.Database.supportsCreateIfNotExists.

Does the database support the "if not exits" syntax?

public boolean
supportsDDLInTransaction()

Implements liquibase.database.Database.supportsDDLInTransaction.

Determines if the database supports DDL within a transaction or not.

public boolean
public boolean
public boolean
supportsInitiallyDeferrableColumns()

Implements liquibase.database.Database.supportsInitiallyDeferrableColumns.

Returns whether this database support initially deferrable columns.

public boolean
supportsNotNullConstraintNames()

Implements liquibase.database.Database.supportsNotNullConstraintNames.

Does this database treat NOT NULL as an own kind of CONSTRAINT (in addition of simply being a column property)?

public boolean
public boolean
public boolean
public boolean
public boolean
public void
tag(final String tagString)

Implements liquibase.database.Database.tag.

Tags the database changelog with the given string.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

public String
public String
public void
updateChecksum(final ChangeSet changeSet)

public ValidationErrors
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait