Windows & Linux

CLI release

Coming January 2027. The dbHydrate command-line tool isn't available yet. These preview docs describe the planned first release; commands and options may change.
Browse CLI documentation

Command reference

Every command works on files exported from the desktop app, and secrets come only from environment variables.

On this page

Choosing what to compare

Input options
OptionMeaning
--run <file.dbhrun>One run file with the source, the target and the profile’s choices.
--source <file.dbhconn>The source connection. Always opened read-only.
--target <file.dbhconn>The target connection.
  • Use either --run, or both --source and --target.
  • Both connections must use the same database engine and belong to the same seat or trial.
  • With connection files, the comparison uses default choices for that engine. Use a run file to compare a specific selection.

dbhydrate compare

Reads both schemas and reports every table, column, index, constraint, view, function and other supported object that differs. Destructive changes, such as dropping a column, are flagged. It never shows SQL.

Example

Example command
dbhydrate compare --run release.dbhrun --report report.md
Illustrative output
  ~ table  public.orders           column "discount_code" missing on target
  + index  public.idx_orders_date  missing on target
  - view   public.legacy_totals    only on target (destructive)
  3 differences, 1 destructive.

Options

dbhydrate compare options
FlagValuePurpose
--reportFile pathWrite a readable Markdown report.
--jsonFile pathWrite a JSON report for other tools.
--no-fail-on-driftNoneExit with code 0 even when differences are found.
Symbols in compare output
SymbolMeaning
+In the source, missing on the target: would be created.
~In both, but different: would be changed.
-Only on the target: would be dropped.

Exit codes

Sample output, for illustration. Exit codes: 0 when there are no differences, 1 when there are (unless --no-fail-on-drift). If part of a schema can’t be read, for example because of a missing permission, the report says the comparison is incomplete and the exit code is 1.

dbhydrate dry-run

Runs every planned change against the target and rolls it back, collecting each step’s result. Problems such as a missing permission, a dependency or data that breaks a new constraint show up before anything changes. See database engines for how each engine rehearses.

Example

Example command
dbhydrate dry-run --run release.dbhrun --report dry-run.md

Options

dbhydrate dry-run options
OptionMeaning
--report, --jsonAs for compare, plus each step’s result. The SQL is included for licenses, not for trials.
--wait <duration>Wait up to this long if the seat is busy, for example --wait 10m.

Exit codes & requirements

Needs an active license or trial. Exit codes: 0 when every step passes, 1 when any step fails.

dbhydrate apply

Applies the changes to the target. --confirm-target must match the target database’s name exactly, the same typed confirmation as the desktop app. There is no --yes.

Example

Bash example
export DBHYDRATE_LICENSE_KEY="$SEAT_KEY"
dbhydrate apply --run release.dbhrun --confirm-target orders_prod --report apply.md

Options

dbhydrate apply options
OptionMeaning
--confirm-target <name>Required. The target database’s name.
--report, --jsonAs for dry-run, plus whether each step was applied.
--wait <duration>Wait up to this long if the seat is busy.

Requirements

  • Needs an active license, a product that covers the target’s engine, and the exporting seat’s license key.
  • A target connection marked read-only is refused.
  • Run dry-run first. In a pipeline, run it in the same job before apply.

Once apply starts changing the target, it finishes. A brief loss of contact with the licensing service never stops it halfway.

dbhydrate file inspect

Shows a file’s readable header and checks its signature, without the passphrase and without contacting your databases. Use it to find out what a file is for, when it expires and whether it has been changed.

dbhydrate help

Help topics
TopicCovers
exportExporting files from the desktop app
licenseLicenses, trials, seats and the license key
ciPipeline examples
exit-codesExit codes and reports
securityEncryption, what the service stores, revoking
troubleshootingCommon problems and fixes

Environment variables

Secrets are read only from the environment, never from command-line arguments, so they don’t appear in process lists or CI logs.

dbhydrate environment variables
VariableUse
DBHYDRATE_CONN_PASSPHRASEPassphrase for every file in the run.
DBHYDRATE_SOURCE_PASSPHRASE / DBHYDRATE_TARGET_PASSPHRASESeparate passphrases for the source and target files, when they differ. They take priority over DBHYDRATE_CONN_PASSPHRASE.
DBHYDRATE_SOURCE_PASSWORD / DBHYDRATE_TARGET_PASSWORDDatabase passwords for files exported without one. Ignored for files that include a password.
DBHYDRATE_LICENSE_KEYThe license key of the seat that exported the files. Needed for apply only.
HTTPS_PROXY / NO_PROXYA company proxy for reaching api.dbhydrate.com. Database connections don’t use it.

Cancelling

Ctrl+C, a stopped CI job or a CI timeout ends the run cleanly: uncommitted changes are rolled back, a MySQL shadow database is removed, the seat is released, and the exit code is 130.

Synopsis

Code example
dbhydrate compare  (--run <file.dbhrun> | --source <a.dbhconn> --target <b.dbhconn>) [--report <file.md>] [--json <file.json>] [--no-fail-on-drift]
dbhydrate dry-run  (--run … | --source … --target …) [--report …] [--json …] [--wait <duration>]
dbhydrate apply    (--run … | --source … --target …) --confirm-target <name> [--report …] [--json …] [--wait <duration>]
dbhydrate file inspect <file>
dbhydrate help [topic]
dbhydrate --version