updateCountSQL

The updateCountSQL command is a helper command that inspects the SQL Liquibase will run while using the updateCount command.

Uses

The updateCountSQL command is used to inspect the raw SQL before running the updateCount command, so you can correct any issues that may arise before running the command. Liquibase uses the raw SQL to apply a specified number of database changes you have added to the changelog file.

Running the updateCountSQL command

To run the updateCountSQL command, you can specify the driver, classpath, and URL in the liquibase.properties file. For more information, see Creating and configuring a liquibase.properties file. You can also specify these in your command line.

Then run the updateCountSQL command:

liquibase --changeLogFile=postgres_lbpro_master_changelog.xml updateCountSQL 2

Note: Enter the name of the changelog and the number that you want to use in place of postgres_lbpro_master_changelog.xmland 2.

updateCountSQL global attributes

Attribute

Definition

Requirement

--changeLogFile *

Specifies the root changelog

Required

--url

Specifies the JDBC database connection URL

Required

--username

Specifies the database username

Required

--password

Specifies the database password

Required

--outputFile **

Specifies the file path to where the updateCount SQL will be written

Optional

*Liquibase checks the changelog and any nested changelogs for the definitions of the changeset to update.

** If not specified, the updateCountSQL output goes to STDOUT.

Note: The username and password attributes are not required for connections and systems which use alternate means of authentication.

updateCountSQL command attributes

Attribute Definition Requirement

<value>

The integer indicating the number of changes you want to update

Required