Class CommandLineUtils
java.lang.Object
liquibase.integration.commandline.CommandLineUtils
Common Utility methods used in the CommandLine application and the Maven plugin.
These methods were originally moved from
Main
so they could be shared.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic Database
createDatabaseObject
(ClassLoader classLoader, String url, String username, String password, String driver, String defaultCatalogName, String defaultSchemaName, boolean outputDefaultCatalog, boolean outputDefaultSchema, String databaseClass, String driverPropertiesFile, String propertyProviderClass, String liquibaseCatalogName, String liquibaseSchemaName, String databaseChangeLogTableName, String databaseChangeLogLockTableName) Deprecated.Use ResourceAccessor versionstatic Database
createDatabaseObject
(ResourceAccessor resourceAccessor, String url, String username, String password, String driver, String defaultCatalogName, String defaultSchemaName, boolean outputDefaultCatalog, boolean outputDefaultSchema, String databaseClass, String driverPropertiesFile, String propertyProviderClass, String liquibaseCatalogName, String liquibaseSchemaName, String databaseChangeLogTableName, String databaseChangeLogLockTableName) Deprecated.static CommandScope
createDiffCommand
(Database referenceDatabase, Database targetDatabase, String snapshotTypes, CompareControl.SchemaComparison[] schemaComparisons, ObjectChangeFilter objectChangeFilter, PrintStream output) static void
static void
doDiff
(Database referenceDatabase, Database targetDatabase, String snapshotTypes, CompareControl.SchemaComparison[] schemaComparisons) static void
doDiff
(Database referenceDatabase, Database targetDatabase, String snapshotTypes, CompareControl.SchemaComparison[] schemaComparisons, PrintStream output) static void
doDiff
(Database referenceDatabase, Database targetDatabase, String snapshotTypes, CompareControl.SchemaComparison[] schemaComparisons, ObjectChangeFilter objectChangeFilter, PrintStream output) static void
doDiffToChangeLog
(String changeLogFile, Database referenceDatabase, Database targetDatabase, String author, DiffOutputControl diffOutputControl, ObjectChangeFilter objectChangeFilter, String snapshotTypes) Deprecated.Use version with String runOnChangeTypes, String replaceIfExistsTypes instead -doDiffToChangeLog(String, Database, Database, String, DiffOutputControl, ObjectChangeFilter, String, String, String)
static void
doDiffToChangeLog
(String changeLogFile, Database referenceDatabase, Database targetDatabase, String author, DiffOutputControl diffOutputControl, ObjectChangeFilter objectChangeFilter, String snapshotTypes, String runOnChangeTypes, String replaceIfExistsTypes) static void
doDiffToChangeLog
(String changeLogFile, Database referenceDatabase, Database targetDatabase, String author, DiffOutputControl diffOutputControl, ObjectChangeFilter objectChangeFilter, String snapshotTypes, CompareControl.SchemaComparison[] schemaComparisons) Deprecated.Use version with String runOnChangeTypes, String replaceIfExistsTypes instead -doDiffToChangeLog(String, Database, Database, String, DiffOutputControl, ObjectChangeFilter, String, CompareControl.SchemaComparison[], String, String)
static void
doDiffToChangeLog
(String changeLogFile, Database referenceDatabase, Database targetDatabase, String author, DiffOutputControl diffOutputControl, ObjectChangeFilter objectChangeFilter, String snapshotTypes, CompareControl.SchemaComparison[] schemaComparisons, String runOnChangeTypes, String replaceIfExistsTypes) static void
doGenerateChangeLog
(String changeLogFile, Database originalDatabase, String catalogName, String schemaName, String snapshotTypes, String author, String context, String dataDir, DiffOutputControl diffOutputControl) Deprecated.Use version with String runOnChangeTypes, String replaceIfExistsTypes instead -doGenerateChangeLog(String, Database, String, String, String, String, String, String, DiffOutputControl, String, String)
static void
doGenerateChangeLog
(String changeLogFile, Database originalDatabase, String catalogName, String schemaName, String snapshotTypes, String author, String context, String dataDir, DiffOutputControl diffOutputControl, String runOnChangeTypes, String replaceIfExistsTypes) static void
doGenerateChangeLog
(String changeLogFile, Database originalDatabase, CatalogAndSchema[] schemas, String snapshotTypes, String author, String context, String dataDir, DiffOutputControl diffOutputControl) Deprecated.Use version with String runOnChangeTypes, String replaceIfExistsTypes instead -doGenerateChangeLog(String, Database, String, String, String, String, String, String, DiffOutputControl, String, String)
static void
doGenerateChangeLog
(String changeLogFile, Database originalDatabase, CatalogAndSchema[] schemas, String snapshotTypes, String author, String context, String dataDir, DiffOutputControl diffOutputControl, boolean overwriteOutputFile) Deprecated.Use version with String runOnChangeTypes, String replaceIfExistsTypes instead -doGenerateChangeLog(String, Database, CatalogAndSchema[], String, String, String, String, DiffOutputControl, String, String)
static void
doGenerateChangeLog
(String changeLogFile, Database originalDatabase, CatalogAndSchema[] schemas, String snapshotTypes, String author, String context, String dataDir, DiffOutputControl diffOutputControl, boolean overwriteOutputFile, String runOnChangeTypes, String replaceIfExistsTypes) static void
doGenerateChangeLog
(String changeLogFile, Database originalDatabase, CatalogAndSchema[] schemas, String snapshotTypes, String author, String context, String dataDir, DiffOutputControl diffOutputControl, String runOnChangeTypes, String replaceIfExistsTypes) static String
-
Constructor Details
-
CommandLineUtils
public CommandLineUtils()
-
-
Method Details
-
createDatabaseObject
public static Database createDatabaseObject(ClassLoader classLoader, String url, String username, String password, String driver, String defaultCatalogName, String defaultSchemaName, boolean outputDefaultCatalog, boolean outputDefaultSchema, String databaseClass, String driverPropertiesFile, String propertyProviderClass, String liquibaseCatalogName, String liquibaseSchemaName, String databaseChangeLogTableName, String databaseChangeLogLockTableName) throws DatabaseException Deprecated.Use ResourceAccessor version- Throws:
DatabaseException
-
createDatabaseObject
@Deprecated public static Database createDatabaseObject(ResourceAccessor resourceAccessor, String url, String username, String password, String driver, String defaultCatalogName, String defaultSchemaName, boolean outputDefaultCatalog, boolean outputDefaultSchema, String databaseClass, String driverPropertiesFile, String propertyProviderClass, String liquibaseCatalogName, String liquibaseSchemaName, String databaseChangeLogTableName, String databaseChangeLogLockTableName) throws DatabaseException Deprecated.- Throws:
DatabaseException
-
doDiff
public static void doDiff(Database referenceDatabase, Database targetDatabase, String snapshotTypes) throws LiquibaseException - Throws:
LiquibaseException
-
doDiff
public static void doDiff(Database referenceDatabase, Database targetDatabase, String snapshotTypes, CompareControl.SchemaComparison[] schemaComparisons) throws LiquibaseException - Throws:
LiquibaseException
-
doDiff
public static void doDiff(Database referenceDatabase, Database targetDatabase, String snapshotTypes, CompareControl.SchemaComparison[] schemaComparisons, PrintStream output) throws LiquibaseException - Throws:
LiquibaseException
-
createDiffCommand
public static CommandScope createDiffCommand(Database referenceDatabase, Database targetDatabase, String snapshotTypes, CompareControl.SchemaComparison[] schemaComparisons, ObjectChangeFilter objectChangeFilter, PrintStream output) throws CommandExecutionException - Throws:
CommandExecutionException
-
doDiff
public static void doDiff(Database referenceDatabase, Database targetDatabase, String snapshotTypes, CompareControl.SchemaComparison[] schemaComparisons, ObjectChangeFilter objectChangeFilter, PrintStream output) throws LiquibaseException - Throws:
LiquibaseException
-
doDiffToChangeLog
@Deprecated public static void doDiffToChangeLog(String changeLogFile, Database referenceDatabase, Database targetDatabase, String author, DiffOutputControl diffOutputControl, ObjectChangeFilter objectChangeFilter, String snapshotTypes) throws LiquibaseException, IOException, ParserConfigurationException Deprecated.Use version with String runOnChangeTypes, String replaceIfExistsTypes instead -doDiffToChangeLog(String, Database, Database, String, DiffOutputControl, ObjectChangeFilter, String, String, String)
-
doDiffToChangeLog
public static void doDiffToChangeLog(String changeLogFile, Database referenceDatabase, Database targetDatabase, String author, DiffOutputControl diffOutputControl, ObjectChangeFilter objectChangeFilter, String snapshotTypes, String runOnChangeTypes, String replaceIfExistsTypes) throws LiquibaseException, IOException, ParserConfigurationException -
doDiffToChangeLog
@Deprecated public static void doDiffToChangeLog(String changeLogFile, Database referenceDatabase, Database targetDatabase, String author, DiffOutputControl diffOutputControl, ObjectChangeFilter objectChangeFilter, String snapshotTypes, CompareControl.SchemaComparison[] schemaComparisons) throws LiquibaseException, IOException, ParserConfigurationException Deprecated.Use version with String runOnChangeTypes, String replaceIfExistsTypes instead -doDiffToChangeLog(String, Database, Database, String, DiffOutputControl, ObjectChangeFilter, String, CompareControl.SchemaComparison[], String, String)
-
doDiffToChangeLog
public static void doDiffToChangeLog(String changeLogFile, Database referenceDatabase, Database targetDatabase, String author, DiffOutputControl diffOutputControl, ObjectChangeFilter objectChangeFilter, String snapshotTypes, CompareControl.SchemaComparison[] schemaComparisons, String runOnChangeTypes, String replaceIfExistsTypes) throws LiquibaseException, IOException, ParserConfigurationException -
doGenerateChangeLog
@Deprecated public static void doGenerateChangeLog(String changeLogFile, Database originalDatabase, String catalogName, String schemaName, String snapshotTypes, String author, String context, String dataDir, DiffOutputControl diffOutputControl) throws IOException, ParserConfigurationException, LiquibaseException Deprecated.Use version with String runOnChangeTypes, String replaceIfExistsTypes instead -doGenerateChangeLog(String, Database, String, String, String, String, String, String, DiffOutputControl, String, String)
-
doGenerateChangeLog
public static void doGenerateChangeLog(String changeLogFile, Database originalDatabase, String catalogName, String schemaName, String snapshotTypes, String author, String context, String dataDir, DiffOutputControl diffOutputControl, String runOnChangeTypes, String replaceIfExistsTypes) throws IOException, ParserConfigurationException, LiquibaseException -
doGenerateChangeLog
@Deprecated public static void doGenerateChangeLog(String changeLogFile, Database originalDatabase, CatalogAndSchema[] schemas, String snapshotTypes, String author, String context, String dataDir, DiffOutputControl diffOutputControl) throws IOException, ParserConfigurationException, LiquibaseException Deprecated.Use version with String runOnChangeTypes, String replaceIfExistsTypes instead -doGenerateChangeLog(String, Database, String, String, String, String, String, String, DiffOutputControl, String, String)
-
doGenerateChangeLog
public static void doGenerateChangeLog(String changeLogFile, Database originalDatabase, CatalogAndSchema[] schemas, String snapshotTypes, String author, String context, String dataDir, DiffOutputControl diffOutputControl, String runOnChangeTypes, String replaceIfExistsTypes) throws IOException, ParserConfigurationException, LiquibaseException -
doGenerateChangeLog
@Deprecated public static void doGenerateChangeLog(String changeLogFile, Database originalDatabase, CatalogAndSchema[] schemas, String snapshotTypes, String author, String context, String dataDir, DiffOutputControl diffOutputControl, boolean overwriteOutputFile) throws IOException, ParserConfigurationException, LiquibaseException Deprecated.Use version with String runOnChangeTypes, String replaceIfExistsTypes instead -doGenerateChangeLog(String, Database, CatalogAndSchema[], String, String, String, String, DiffOutputControl, String, String)
-
doGenerateChangeLog
public static void doGenerateChangeLog(String changeLogFile, Database originalDatabase, CatalogAndSchema[] schemas, String snapshotTypes, String author, String context, String dataDir, DiffOutputControl diffOutputControl, boolean overwriteOutputFile, String runOnChangeTypes, String replaceIfExistsTypes) throws IOException, ParserConfigurationException, LiquibaseException -
getBanner
-