supaschema diff reads declarative SQL, compares it with the configured source state, and writes a migration that supaschema sync or the Supabase CLI can apply.
Use this when
- CI cannot run Docker reliably.
- You want schema diffing without a shadow database.
- The review should include replay-safety checks before any Supabase apply path.
- You want the option to run the Supabase CLI through a configured
supaschema synctarget.
Do this
Put declarative SQL under the configured Supabase schema path:sync runs the safety gates and then invokes the config-selected direct PostgreSQL or Supabase CLI runner. Target config decides selection: every sync.targets.<name> entry with mode: "auto" joins the bare sync path. Remote targets also require their approval variable before deploy. Use supabase db push directly only when your deployment process intentionally keeps the Supabase CLI as a separate operational step.
Verify
Use a disposable PostgreSQL database for apply-twice proof:Related
Supabase integration
See the Supabase path and runner model.
Diff command
Review source flags and drift behavior.
Check command
Validate replay safety before applying SQL.
Supabase comparison
Compare this flow with
supabase db diff.
