Skip to main content

liquibase CLI reference

ModularPipelines.Liquibase provides strongly typed access to the liquibase CLI.

Installation

dotnet add package ModularPipelines.Liquibase

Import ModularPipelines.Liquibase.Extensions, then resolve the service with context.Liquibase().

Module example

using ModularPipelines.Context;
using ModularPipelines.Models;
using ModularPipelines.Modules;
using ModularPipelines.Liquibase.Extensions;
using ModularPipelines.Liquibase.Options;

public class RunCommandModule : Module<CommandResult>
{
protected override async Task<CommandResult?> ExecuteAsync(
IModuleContext context,
CancellationToken cancellationToken)
{
return await context.Liquibase().CalculateChecksum(
new LiquibaseCalculateChecksumOptions(),
cancellationToken: cancellationToken);
}
}

Global options

Global options are rendered before the selected subcommand.

CLI optionPropertyAvailabilityDescription
--allow-duplicated-changeset-identifiersAllowDuplicatedChangesetIdentifiersAll editionsAllows duplicated changeset identifiers without failing Liquibase execution. DEFAULT: false
--allow-inherit-logical-file-pathAllowInheritLogicalFilePathAll editionsIf true, included changelogs without an explicit logicalFilePath will inherit their parent changelog's logicalFilePath, and explicit logicalFilePath attributes on include statements are honored (Liquibase 4.31.0+ behavior). If false, included changelogs use their physical file paths, ignoring both implicit inheritance and explicit logicalFilePath attributes on include statements. Only logicalFilePath set directly on the changelog itself is respected. Defaults to true for backward compatibility. DEFAULT: true
--always-drop-instead-of-replaceAlwaysDropInsteadOfReplaceAll editionsIf true, drop and recreate a view instead of replacing it. DEFAULT: false
--always-override-stored-logic-schemaAlwaysOverrideStoredLogicSchemaAll editionsWhen generating SQL for createProcedure, should the procedure schema be forced to the default schema if no schemaName attribute is set? DEFAULT: false
--analytics-enabledAnalyticsEnabledAll editionsEnable or disable sending product usage data and analytics to Liquibase. Learn more at https: //docs.liquibase.com/analytics.
--auto-reorgAutoReorgAll editionsShould Liquibase automatically include REORG TABLE commands when needed? DEFAULT: true
--changelog-lock-poll-rateChangelogLockPollRateAll editionsNumber of seconds wait between checks to the changelog lock when it is locked DEFAULT: 10
--changelog-lock-wait-time-in-minutesChangelogLockWaitTimeInMinutesAll editionsNumber of minutes to wait for the changelog lock to be available before giving up DEFAULT: 5
--changelog-parse-modeChangelogParseModeAll editionsConfigures how to handle unknown fields in changelog files. Possible values: STRICT which causes parsing to fail, and LAX which continues with the parsing. DEFAULT: STRICT
--classpathClasspathAll editionsAdditional classpath entries to use
--convert-data-typesConvertDataTypesAll editionsShould Liquibase convert to/from STANDARD data types. Applies to both snapshot and update commands. DEFAULT: true
--database-changelog-lock-table-nameDatabaseChangelogLockTableNameAll editionsName of table to use for tracking concurrent Liquibase usage DEFAULT: DATABASECHANGELOGLOCK
--database-changelog-table-nameDatabaseChangelogTableNameAll editionsName of table to use for tracking change history DEFAULT: DATABASECHANGELOG
--database-classDatabaseClassAll editionsClass to use for Database implementation
--databricks-diff-tblproperties-exclude-patternsDatabricksDiffTblPropertiesExcludePatternsLiquibase Secure with the Databricks extensionComma-separated TBLPROPERTIES key prefixes to exclude from Databricks diff operations.
--databricks-diff-tblproperties-ignore-allDatabricksDiffTblPropertiesIgnoreAllLiquibase Secure with the Databricks extensionIgnore all TBLPROPERTIES during Databricks diff operations.
--ddl-lock-timeoutDdlLockTimeoutAll editionsThe DDL_LOCK_TIMEOUT parameter indicates the number of seconds a DDL command should wait for the locks to become available before throwing the resource busy error message. This applies only to Oracle databases.
--defaults-fileDefaultsFileAll editionsFile with default Liquibase properties DEFAULT: liquibase.properties
--diff-column-default-value-constraint-nameDiffColumnDefaultValueConstraintNameAll editionsShould Liquibase compare column default value constraint name in diff operation? DEFAULT: true
--diff-column-orderDiffColumnOrderAll editionsShould Liquibase compare column order in diff operation? DEFAULT: true
--driverDriverAll editionsDatabase driver class
--driver-properties-fileDriverPropertiesFileAll editionsDriver-specific properties
--duplicate-file-modeDuplicateFileModeAll editionsHow to handle multiple files being found in the search path that have duplicate paths. Options are SILENT (do not log and choose one at random), DEBUG, INFO, WARN (log at the given level and choose one at random), or ERROR (fail current operation). DEFAULT: ERROR
--error-on-circular-include-allErrorOnCircularIncludeAllAll editionsThrow an error if Liquibase detects that an includeAll will cause a circular reference (and thus a changelog parse error). DEFAULT: true
--fail-on-null-snapshot-idFailOnNullSnapshotIdAll editionsIf true, referenced objects which do not have a snapshot ID will cause snapshot failure DEFAULT: true
--file-encodingFileEncodingAll editionsEncoding to use when reading files. Valid values include: UTF-8, UTF-16, UTF-16BE, UTF-16LE, US-ASCII, or OS to use the system configured encoding. DEFAULT: UTF-8
--filter-log-messagesFilterLogMessagesAll editionsDEPRECATED: No longer used
--generate-changeset-created-valuesGenerateChangesetCreatedValuesAll editionsShould Liquibase include a 'created' attribute in diff/generateChangelog changesets with the current datetime DEFAULT: false
--generated-changeset-ids-contains-descriptionGeneratedChangesetIdsContainsDescriptionAll editionsShould Liquibase include the change description in the id when generating changesets? DEFAULT: false
--headlessHeadlessAll editionsForce Liquibase to think it has no access to a keyboard DEFAULT: false
--helpHelpAll editionsShow this help message and exit
--include-catalog-in-specificationIncludeCatalogInSpecificationAll editionsShould Liquibase include the catalog name when determining equality? DEFAULT: false
--include-relations-for-computed-columnsIncludeRelationsForComputedColumnsAll editionsIf true, the parent relationship for computed columns is preserved in snapshot-dependent commands: snapshot and diff DEFAULT: false
--include-schema-name-for-defaultIncludeSchemaNameForDefaultAll editionsIf true, the schema name is included for the default schema when loading a snapshot DEFAULT: false
--include-system-classpathIncludeSystemClasspathAll editionsInclude the system classpath when resolving classes at runtime DEFAULT: true
--license-keyLicenseKeyLiquibase SecureSpecifies the license key that enables Liquibase Secure functionality.
--liquibase-catalog-nameLiquibaseCatalogNameAll editionsCatalog to use for Liquibase objects
--liquibase-schema-nameLiquibaseSchemaNameAll editionsSchema to use for Liquibase objects
--liquibase-tablespace-nameLiquibaseTablespaceNameAll editionsTablespace to use for Liquibase objects
--log-channelsLogChannelsAll editionsDEFAULT: Controls which log channels have their level set by the liquibase.logLevel setting. Comma separate multiple values. To set the level of all channels, use 'all'. Example: liquibase, org.mariadb.jdbc
--log-fileLogFileAll editionsUsers can use .gz file extension to enable log files compression.
--log-formatLogFormatAll editionsSets the format of log output to console or log files. Community users default to unstructured "TEXT" logs to the console or output log files. Pro users have the option to set value as "JSON" or "JSON_PRETTY" to enable json-structured log files to the console or output log files. DEFAULT: TEXT
--log-levelLogLevelAll editionsDEFAULT: Controls which logs get set to stderr AND to any log file. The CLI defaults, if log file set, to SEVERE. Others vary by integration. The official log levels are: OFF, SEVERE, WARNING, INFO, FINE
--mirror-console-messages-to-logMirrorConsoleMessagesToLogAll editionsWhen set to true, the console messages are mirrored to the logs as [liquibase.ui] to provide a more complete picture of liquibase operations to log analysis tools. Set to false to change this behavior. DEFAULT: true
--missing-property-modeMissingPropertyModeAll editionsHow to handle changelog property expressions where a value is not set. For example, a string 'null' when no 'address' property was defined. Values can be: 'preserve' which leaves the string as-is, 'empty' which replaces it with an empty string, or 'error' which stops processing with an error. DEFAULT: PRESERVE
--monitor-performanceMonitorPerformanceAll editionsEnable performance tracking. Set to 'false' to disable. If set to 'true', data is stored to a liquibase-TIMESTAMP.jfr file in your working directory. Any other value will enable tracking and be used as the name of the file to write the data to. DEFAULT: false
--mssql-bytes-per-charMssqlBytesPerCharAll editionsNumber of bytes needed to store one character (depends on database's character encoding) DEFAULT: 1
--on-missing-include-changelogOnMissingIncludeChangelogAll editionsIf set to WARN, then liquibase will not throw exception on missing changelog file, instead will show a warning message. DEFAULT: FAIL
--output-fileOutputFileAll editions
--output-file-encodingOutputFileEncodingAll editionsEncoding to use when writing files DEFAULT: UTF-8
--output-line-separatorOutputLineSeparatorAll editionsLine separator for output DEFAULT: Line separator(LF or CRLF) for output. Defaults to OS default
--preserve-classpath-prefix-in-normalized-pathsPreserveClasspathPrefixInNormalizedPathsAll editionsIf true 'classpath:' prefix will be preserved in normalized paths, allowing to resolve hierarchical resources under a classpath-based root. DEFAULT: false
--preserve-schema-casePreserveSchemaCaseAll editionsIf true, Liquibase treats schema and catalog names as case sensitive DEFAULT: false
--prompt-for-non-local-databasePromptForNonLocalDatabaseAll editionsShould Liquibase prompt if a non-local database is being accessed
--property-provider-classPropertyProviderClassAll editionsImplementation of Properties class to provide additional driver properties
--search-pathSearchPathAll editionsComplete list of Location(s) to search for files such as changelog files in. Multiple paths can be specified by separating them with commas.
--secure-parsingSecureParsingAll editionsIf true, remove functionality from file parsers which could be used insecurely. Examples include (but not limited to) disabling remote XML entity support. DEFAULT: true
--should-runShouldRunAll editionsShould Liquibase commands execute DEFAULT: true
--should-snapshot-dataShouldSnapshotDataAll editionsShould Liquibase snapshot data by default? DEFAULT: false
--show-bannerShowBannerAll editionsIf true, show a Liquibase banner on startup. DEFAULT: true
--sql-log-levelSqlLogLevelAll editionsLevel to log SQL statements to DEFAULT: FINE
--sql-show-sql-warningsSqlShowSqlWarningsAll editionsShow SQLWarning messages DEFAULT: true
--strictStrictAll editionsIf true, Liquibase enforces certain best practices and proactively looks for common errors DEFAULT: false
--support-property-escapingSupportPropertyEscapingAll editionsSupport escaping changelog parameters using a colon. Example: null DEFAULT: false
--supports-method-validation-levelSupportsMethodValidationLevelAll editionsControls the level of validation performed on the supports method of Change classes. Options are OFF, WARN, FAIL. DEFAULT: WARN
--suppress-liquibase-sqlSuppressLiquibaseSqlAll editionsWhen set to true, this global property prevents DBCL and DBCLH sql from being present in console and logs during *-sql commands, such as update-sql, rollback-sql, etc. DEFAULT: false
--trim-load-data-file-headerTrimLoadDataFileHeaderAll editionsIf true column headers will be trimmed in case they were specified with spaces in the file. DEFAULT: false
--ui-serviceUiServiceAll editionsChanges the default UI Service Logger used by Liquibase. Options are CONSOLE or LOGGER. DEFAULT: CONSOLE
--use-procedure-schemaUseProcedureSchemaAll editionsIf set to true (default value), createProcedure tags with a set schemaName will modify the procedure body with the given schema name. DEFAULT: true
--validate-xml-changelog-filesValidateXmlChangelogFilesAll editionsWill perform XSD validation of XML changelog files. When many XML changelog files are included, this validation may impact Liquibase performance. Defaults to true. DEFAULT: true
--versionVersionAll editionsPrint version information and exit

Commands

CLI commandOptions record
liquibase calculate-checksumLiquibaseCalculateChecksumOptions
liquibase changelog-syncLiquibaseChangelogSyncOptions
liquibase changelog-sync-sqlLiquibaseChangelogSyncSqlOptions
liquibase changelog-sync-to-tagLiquibaseChangelogSyncToTagOptions
liquibase changelog-sync-to-tag-sqlLiquibaseChangelogSyncToTagSqlOptions
liquibase clear-checksumsLiquibaseClearChecksumsOptions
liquibase db-docLiquibaseDbDocOptions
liquibase diffLiquibaseDiffOptions
liquibase diff-changelogLiquibaseDiffChangelogOptions
liquibase drop-allLiquibaseDropAllOptions
liquibase execute-sqlLiquibaseExecuteSqlOptions
liquibase future-rollback-count-sqlLiquibaseFutureRollbackCountSqlOptions
liquibase future-rollback-from-tag-sqlLiquibaseFutureRollbackFromTagSqlOptions
liquibase future-rollback-sqlLiquibaseFutureRollbackSqlOptions
liquibase generate-changelogLiquibaseGenerateChangelogOptions
liquibase historyLiquibaseHistoryOptions
liquibase initLiquibaseInitOptions
liquibase init projectLiquibaseInitProjectOptions
liquibase init start-h2LiquibaseInitStartH2Options
liquibase list-locksLiquibaseListLocksOptions
liquibase mark-next-changeset-ranLiquibaseMarkNextChangesetRanOptions
liquibase mark-next-changeset-ran-sqlLiquibaseMarkNextChangesetRanSqlOptions
liquibase release-locksLiquibaseReleaseLocksOptions
liquibase rollbackLiquibaseRollbackOptions
liquibase rollback-countLiquibaseRollbackCountOptions
liquibase rollback-count-sqlLiquibaseRollbackCountSqlOptions
liquibase rollback-sqlLiquibaseRollbackSqlOptions
liquibase rollback-to-dateLiquibaseRollbackToDateOptions
liquibase rollback-to-date-sqlLiquibaseRollbackToDateSqlOptions
liquibase snapshotLiquibaseSnapshotOptions
liquibase snapshot-referenceLiquibaseSnapshotReferenceOptions
liquibase statusLiquibaseStatusOptions
liquibase tagLiquibaseTagOptions
liquibase tag-existsLiquibaseTagExistsOptions
liquibase unexpected-changesetsLiquibaseUnexpectedChangesetsOptions
liquibase updateLiquibaseUpdateOptions
liquibase update-countLiquibaseUpdateCountOptions
liquibase update-count-sqlLiquibaseUpdateCountSqlOptions
liquibase update-sqlLiquibaseUpdateSqlOptions
liquibase update-testing-rollbackLiquibaseUpdateTestingRollbackOptions
liquibase update-to-tagLiquibaseUpdateToTagOptions
liquibase update-to-tag-sqlLiquibaseUpdateToTagSqlOptions
liquibase validateLiquibaseValidateOptions