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
| Option | Meaning |
|---|---|
--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--sourceand--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
dbhydrate compare --run release.dbhrun --report report.md ~ 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
| Flag | Value | Purpose |
|---|---|---|
--report | File path | Write a readable Markdown report. |
--json | File path | Write a JSON report for other tools. |
--no-fail-on-drift | None | Exit with code 0 even when differences are found. |
| Symbol | Meaning |
|---|---|
+ | 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
dbhydrate dry-run --run release.dbhrun --report dry-run.mdOptions
| Option | Meaning |
|---|---|
--report, --json | As 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
export DBHYDRATE_LICENSE_KEY="$SEAT_KEY"
dbhydrate apply --run release.dbhrun --confirm-target orders_prod --report apply.mdOptions
| Option | Meaning |
|---|---|
--confirm-target <name> | Required. The target database’s name. |
--report, --json | As 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-runfirst. In a pipeline, run it in the same job beforeapply.
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
| Topic | Covers |
|---|---|
export | Exporting files from the desktop app |
license | Licenses, trials, seats and the license key |
ci | Pipeline examples |
exit-codes | Exit codes and reports |
security | Encryption, what the service stores, revoking |
troubleshooting | Common 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.
| Variable | Use |
|---|---|
DBHYDRATE_CONN_PASSPHRASE | Passphrase for every file in the run. |
DBHYDRATE_SOURCE_PASSPHRASE / DBHYDRATE_TARGET_PASSPHRASE | Separate passphrases for the source and target files, when they differ. They take priority over DBHYDRATE_CONN_PASSPHRASE. |
DBHYDRATE_SOURCE_PASSWORD / DBHYDRATE_TARGET_PASSWORD | Database passwords for files exported without one. Ignored for files that include a password. |
DBHYDRATE_LICENSE_KEY | The license key of the seat that exported the files. Needed for apply only. |
HTTPS_PROXY / NO_PROXY | A 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
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