Skip to content

Command Reference

江河 edited this page Jul 21, 2026 · 2 revisions

Command Reference

Use dbgov <command> --help for exact flags. Use -o json for machine-readable output.

Metadata

dbgov version
dbgov capabilities -o json
dbgov doctor config -o json
dbgov install <agent> --skills

Reads

dbgov query --sql "SELECT ..." -o json
dbgov explain --sql "SELECT ..." -o json
dbgov schema list -o json
dbgov schema describe <table> -o json
dbgov schema dump --dir ./schema --yes -o json

Query JSON preserves SQL NULL as null and distinguishes it from an empty string; table output renders SQL NULL as NULL.

Schema Change

dbgov schema diff -f desired.sql -o json
dbgov schema plan -f desired.sql -o json
dbgov schema apply -f desired.sql --dry-run -o json
dbgov schema apply -f desired.sql --yes -o json
dbgov schema apply -f desired.sql --ticket DB-123 --allow-destructive --yes -o json

Governed DML

dbgov data exec --sql "UPDATE ... WHERE ..." --dry-run -o json
dbgov data exec --sql "UPDATE ... WHERE id = 42" --yes -o json
dbgov data exec --sql "DELETE FROM sessions" --ticket DB-123 --allow-no-where --yes -o json

GitOps Schema

dbgov export --dir ./schema --yes -o json
dbgov import ./schema --dry-run -o json
dbgov reconcile ./schema --dry-run -o json
dbgov reconcile ./schema --prune --ticket DB-123 --allow-production-prune --yes -o json
dbgov rollback list -o json
dbgov rollback --to <snapshot-id> --dry-run -o json

Audit

dbgov audit query --since 24h -o json
dbgov audit verify -o json
dbgov audit prune --before 30d -o json
dbgov audit prune --before 30d --confirm --yes --ticket <human-ticket> --allow-audit-prune -o json

Clone this wiki locally