Skip to main content
Use this when you need regression coverage for false drift and catalog parity bugs. The corpus lane applies deliberately messy migrations to a disposable database, reconciles that database against a clean declarative tree, checks the rendered migration, applies it twice, and requires the final diff to converge to zero operations.

Use this when

  • A bug involved false drift or catalog mismatch.
  • Unit fixtures were too clean to catch the failure.
  • You want package-level proof across real PostgreSQL catalog noise.
  • A consuming repo needs its own incident-history corpus.

Do this

Run the bundled corpus:
npm run corpus:check
Or run the CLI directly:
npx supaschema corpus --corpus-dir corpus/supabase-style --database-url "$DATABASE_URL"
Without a resolvable database URL, the command prints a skip notice and exits 0.

Add a case

For every false-drift or parity bug, add the triggering shape in the same change:
  • put the dirty migration in corpus/supabase-style/migrations/;
  • put the clean end state in corpus/supabase-style/tree/;
  • keep expected settings in corpus/supabase-style/corpus.json;
  • prove npm run corpus:check converges.

Benchmarks

See timing and correctness evidence.

Support matrix

Check which PostgreSQL objects are modeled.

Check command

Validate rendered corpus migrations.

Verify command

Compare apply-twice behavior against the declarative tree.
Last modified on June 16, 2026