Skip to main content

Commands

DeepDiff DB exposes a set of focused commands. Each command does one thing; chain them in the order below for the standard workflow.

Command Overview

CommandPurpose
checkValidate config file and test connections to both databases
schema-diffDetect schema drift between production and development
schema-migrateGenerate a standalone schema migration SQL script
diffFull diff: schema introspection + row-level data comparison
gen-packGenerate a complete SQL migration pack (schema + data)
applyApply a migration pack to the production database
resolve-conflictsInteractively (or automatically) resolve data conflicts

Global Flags

The following flags are accepted by all commands:

FlagDefaultDescription
--configdeepdiffdb.config.yamlPath to the configuration file
--verbosefalseEnable debug-level logging with source location
--log-file(none)Write logs to this file in addition to stdout
--log-levelinfoMinimum log level: debug, info, warn, error
--log-formattextLog format: text or json
--batch-size(from config)Rows per keyset-paginated query (overrides performance.hash_batch_size)
--parallel(from config)Max tables hashed concurrently (overrides performance.max_parallel_tables)
--resumefalseResume from the last saved checkpoint

Not every flag applies to every command. Each command page lists the flags it accepts.

# 1. Validate config and connections
deepdiffdb check --config deepdiffdb.config.yaml

# 2. (Optional) Check for schema drift first
deepdiffdb schema-diff --config deepdiffdb.config.yaml

# 3. (Optional) Generate schema migration SQL if there is drift
deepdiffdb schema-migrate --config deepdiffdb.config.yaml

# 4. Run a full diff (schema + data)
deepdiffdb diff --config deepdiffdb.config.yaml

# 5. (Optional) Resolve conflicts interactively
deepdiffdb resolve-conflicts --config deepdiffdb.config.yaml

# 6. Generate the migration pack
deepdiffdb gen-pack --config deepdiffdb.config.yaml

# 7. Review diff-output/migration_pack.sql, then apply
deepdiffdb apply --pack diff-output/migration_pack.sql --config deepdiffdb.config.yaml