Skip to main content
Use plan when you need to inspect schema operations before SQL is rendered. plan runs the same comparison as diff, prints the MigrationPlan JSON, and leaves the filesystem untouched.

Use this when

  • Review automation needs operation data.
  • A migration looks surprising and you want the planner view.
  • You want destructive or blocked operations before rendering SQL.
  • Downstream tooling should summarize schema impact.

Run it

npx supaschema plan
npx supaschema plan --from "git:origin/main" --to dir:database/schemas
npx supaschema plan --schema public,auth
npx supaschema plan | jq '.operations'

Flags

--from
source
Before-state source. Defaults to config.sources.from.
--to
source
Desired-state source. Defaults to config.sources.to.
--schema
names
Plan only the comma-separated PostgreSQL schema names.
--timing
boolean
Print extract and plan timings to stderr.

Exit codes

CodeMeaning
0Plan printed
1Runtime failure
2Plan diagnostics contained an error

Diff

Render the plan as replay-safe SQL.

Inspect

See the extracted model behind a source.

Sources

Pick source specifiers for --from and --to.

Hints

Approve blocked destructive changes.
Last modified on June 16, 2026