dpg dump

dpg dump

Introspect a live database and produce initial .dpg source files

Synopsis

Connects to the primary node, reads the live catalog, and writes initial .dpg source files and a snapshot. Use this to bootstrap a DPG project from an existing database.

If any target file already exists, dump refuses to proceed until you explicitly confirm the overwrite (or pass –yes) — nothing is ever silently clobbered.

Objects whose DDL cannot be cleanly reconstructed from catalog information are emitted as comments with a – dpg:manual marker. Review these manually and replace them with proper DPG declarations.

dpg dump [flags]

Options

      --cluster string    cluster to dump (required when multiple clusters exist)
      --database string   database to dump (required when multiple databases exist)
  -h, --help              help for dump
  -o, --output string     output directory (default: cluster/database/ within project root); when set, sandboxes ALL output here, including cluster-level roles.dpg and the snapshot, not just per-database source
  -y, --yes               skip the interactive overwrite confirmation (for scripts/CI)

Options inherited from parent commands

  -C, --dir string   project root directory (default: current working directory)
      --env string   path to .env file (default: .env in project root, if present)

SEE ALSO

  • dpg - Declarative PG — schema compiler and migration tool
Auto generated by spf13/cobra on 26-Aug-2026