driver-properties-file
The --driver-properties-file
global parameter is a string that specifies a properties file containing database connection properties for the JDBC driver you're using with Liquibase.
Uses
Liquibase is written in Java. To connect it with your database, you need to specify a JDBC (Java Database Connectivity) URL for your database. For example, for a PostgreSQL database:
jdbc:postgresql://localhost:5432/mydatabase
Your JDBC URL can also contain authentication data:
jdbc:postgresql://myuser:mypassword@localhost:5432/mydatabase
Liquibase lets you specify custom values for parameters in the defaults file, which is called liquibase.properties
by default. The defaults file can include your JDBC database URL, username, password, and non-authentication settings that alter the behavior of Liquibase.
However, you may not want to store sensitive database connection properties with all your other Liquibase properties. To separate driver-specific properties from other configuration parameters, specify a filepath as the value of --driver-properties-file
and store your JDBC connection data there instead of in your defaults file. For example, in the CLI:
--driver-properties-file=path/to/driver/properties/file.properties
The syntax of the driver properties file itself is the same as for the defaults file. For example:
url=jdbc:postgresql://localhost:5432/mydatabase
username=myuser
password=mypassword
Syntax
You can set this parameter in the following ways:
Option | Syntax |
---|---|
Liquibase properties file (defaults file) |
|
Global flow file argument (example) |
|
Global CLI parameter |
|
JVM system property (JAVA_OPTS Environment Variable) |
|
Liquibase Environment Variables |
|
For more information, see Working with Command Parameters.