Liquibase Enterprise was formerly known as Datical DB.
Provide Runtime Credentials
Overview: Using Runtime Credentials
If you do not want to store the database credentials, configure the project to use runtime credentials. We recommend this option because it is more secure.
GUI
In the Settings tab, Credential Management section, check Specify database credentials at operation runtime.
CLI
Use the runtimeCredentials
option.
hammer set runtimeCredentials --force true
Runtime Credential Precedence
When the runtime credentials option is set for a project, then during operations, Datical DB checks for where the credentials are specified. Credential locations are checked in the following order:
Explicit credentials for an operation:
CLI - You specify credentials in command options
Environment variables (CLI only)
Prompting. If the credentials are not provided explicitly and the environment variable is not set, Datical DB displays a prompt for the user to enter the credentials.
GUI - Prompt dialog
CLI - Prompt line
Explicit Credentials
If you provide credentials in command options at the CLI, those credentials are checked.
If they fail, no further checking is done, and the command fails.
Single-Credential Commands
The credential options use a space to separate the option and the value. Do not use "=".
Option | Description |
---|---|
One of these forms:
| User name in one of the following forms:
|
One of these forms:
| Password in one of the following forms:
|
One of these forms for DMCDB username ( version 8.3 and later): | User name in this form: |
One of these forms for DMCDB password ( version 8.3 and later): | Password in this form: |
If you pass username and password (with -un and -pw options) in such format: -un <username> -pw <password>, they are going to be set as global credentials.
Example: Forecast Operation
If you want to specify both credentials for source database and DMC DB you should do so in the following format:
hammer forecast DEV -un DEV:::username -pw DEV:::password -dun dmcusername -dpw dmcpassword
DEV
is the equivalent to the source database name.
Two-credential Commands
The diff
and diffChangeLog
commands require two database names as options.
Reference database - Represents the desired state.
Target database - Represents a current state, which is to be measured against the desired state.
The credential options use a space to separate the option and the value. Do not use "=".
Option | Description |
---|---|
| Reference database user name |
| Password for the reference database user name |
| Target database user name |
| Password for the target database user name |
Example: Performing a Diff
In this example, TEST is the reference database (desired state) and DEV is the target database (measured against the desired state).
hammer diff TEST DEV -ru refDbUser -rpw refDbPass -tu targetUser -tpw targetPass
Environment Variables
When the project is set to use runtime credentials and you run an operation from the CLI, environment variables are checked.
Set the following environment variables if you want to provide default credentials for CLI hammer commands:
Environment variables | Description |
DDB_USER | Database credentials. Used for commands that operate on a single database: forecast, deploy, rollback, and package (deployPackager.groovy) operations. |
DDB_USER_<dbDefName> | Database credentials for an individual step (DbDef). Used only for groovy commands, including Note The per-DbDef environment variables are checked first. If they are not set, then DDB_USER and DDB_PASS are checked. |
DDB_REF_USER | Used with REFERENCE variables for commands that operate on two databases.
|
DDB_TARGET_USER | Used with TARGET variables for commands that operate on two databases.
|
DDB_DMCDB_USER | Used to access the DMCDB database. Operations cause entries to be entered in the DMCDB database:
|
Prompts for Credentials
When you perform an action in the GUI, you will be prompted to provide credentials if Runtime credentials are required. (Either the project option is set or no credentials have been entered for a step.)
You are prompted with a dialog:
Video
See also video 9 about Database Credentials
Copyright © Liquibase 2012-2022 - Proprietary and Confidential