DBMT CLI / COMPARE · PLAN · APPLY

Your terminal.
The same considered workflow.

Make PostgreSQL and MySQL schema comparison repeatable with dbmt. Use saved profiles, review generated SQL plans, and keep environment protection gates in place when scripting changes.

Choose your license
14-DAY TRIAL

Meet your next workflow.

Choose the installer for your computer.

On a Mac, check Apple menu → About This Mac for your chip.

Trial installers are not available here yet. Please check back for the download.

$10.95 monthly or $99 yearly One developer, up to two devices

The command instrumentWORKFLOW STUDY
The command instrumentA terminal score reveals the dbmt compare, plan, and apply commands as separate steps. A profile and reviewed SQL sit beside them.dbmt / your shellLOCAL$ dbmt compare$ dbmt plan# inspect the generated SQL$ dbmt apply# target protection gates stay in placeprofileyour targetCOMPARE · PLAN · REVIEW · APPLY

CLI workflow illustration / inspect the plan before apply.

Illustration / example workflow
dbmt · command and workflow illustration

Overview & Installation

dbmt is the native command-line interface for dbmigrate. It is bundled directly with the desktop application for macOS and Windows, sharing the same local encrypted configuration store, connection definitions, and environment protection rules.

# Verify your installation and version
$ dbmt --version
dbmt version 1.0.0 (darwin/arm64)
INTERACTIVE COMMAND BUILDER

Configure Your dbmt Command

Build production-safe CLI commands for local terminals, automated cron jobs, or CI/CD pipelines.

CLI v1.2+ Compatible
bash · terminal
$dbmt compare --profile staging-to-prod --engine postgres

Expected Exit Codes for dbmt compare

  • Exit 0Clean: Schemas match perfectly with zero drift.
  • Exit 1Drift Detected: Schema differences found. Review output diff.
  • Exit 2Connection Error: Failed to reach or authenticate with database.

Working with Profiles

A profile contains your source connection, target connection, selected object filters, and environment protection rules. You can create profiles visually in the desktop application and execute them headlessly with dbmt.

# List all configured profiles stored locally
$ dbmt profiles list

NAME ENGINE SOURCE TARGET PROTECTION
staging-to-prod PostgreSQL dev_db prod_db High
sandbox-refresh MySQL prod_replica sandbox_db Medium

dbmt compare

Inspects source and target schemas for drift according to the profile's filter rules. Outputs a human-readable diff summary and returns standard exit codes for automated testing.

$ dbmt compare --profile staging-to-prod

Comparing [dev_db] → [prod_db] (PostgreSQL 16)
[+] 1 table modified: app.orders (+ status varchar(32))
[+] 1 index added: idx_orders_status
[=] 28 tables unchanged

Drift detected: 2 object differences found.

dbmt plan

Generates ordered, dependency-resolved DDL synchronization SQL without executing it against the target database. Use --out to save the script for auditing, code review, or storage in pull requests.

$ dbmt plan --profile staging-to-prod --out migration-plan.sql
Plan written to ./migration-plan.sql (2 statements, ordered by FK dependency).

dbmt apply

Executes the planned migration against the target database. Respects the target's configured environment protection gates. High-protection targets require dry runs to pass before real execution is permitted.

# Perform a dry run rehearsal first
$ dbmt apply --profile staging-to-prod --dry-run
✓ Dry run succeeded: Target schema valid. No constraint violations.

# Apply migration with target confirmation
$ dbmt apply --profile staging-to-prod --confirm-target prod_db
Applying 2 changes to [prod_db]...
✓ 2/2 changes applied successfully. Snapshot saved to run history.

Protection Gate Notice: In high-protection environments, dbmt apply requires the --confirm-target <dbname> flag to prevent accidental execution against production.

Deterministic Exit Codes

dbmt returns consistent Unix exit codes, making it simple to write shell scripts, Git pre-push hooks, and automated CI quality gates:

  • 0 (Success): Operation succeeded. For compare, means source and target schemas are in sync with zero drift.
  • 1 (Drift Detected): In compare, indicates differences were detected between source and target.
  • 2 (Validation / Gate Failure): Pre-execution dry run failed, or environment protection requirements were not met.
  • 3 (Execution Error): Connection timeout, authentication failure, or SQL execution exception.

GitHub Actions / CI Example

Fail a pull request build if unexpected schema drift is detected between your staging branch and the reference database:

# .github/workflows/schema-drift.yml
name: Check Schema Drift
on: [pull_request]
jobs:
  verify:
    runs-on: [self-hosted, macOS]
    steps:
      - uses: actions/checkout@v4
      - name: Run dbmt drift check
        run: |
          dbmt compare --profile ci-staging-check || exit 1
AUTOMATE YOUR WORKFLOW

Ready to script your migrations?

Download dbmigrate for macOS or Windows. Both the native visual desktop app and the dbmt CLI are included in every installation.

UNIFIED LICENSE14 days

Try the GUI & CLI free for 14 days.

  • Interactive visual diff tool
  • Headless dbmt CLI execution
  • Local AES-256-GCM encrypted state
  • Unlimited databases & schemas
14-DAY TRIAL

Meet your next workflow.

Choose the installer for your computer.

On a Mac, check Apple menu → About This Mac for your chip.

Trial installers are not available here yet. Please check back for the download.

macOS (Apple Silicon & Intel) / Windows x64