Skip to main content
Use this page to see the package surfaces at a glance. supaschema is packaged as a PostgreSQL project workflow, not just a binary. Installing it gives your repo the generator, safety checks, generated outputs, and a raw public-safe agent bundle for optional review and installation. The workflow keeps declarative schema changes repeatable across plain PostgreSQL, Neon, RDS/Aurora, Cloud SQL, AlloyDB, Azure PostgreSQL, and Supabase.

Core workflow

One-command migration generation

supaschema diff extracts, plans, renders, writes the migration, and refreshes configured generated outputs.

Replay-safety checker

supaschema check validates generated migrations before they reach a database.

Apply-twice verification

supaschema verify proves the newest pending migration is replay-safe against a disposable database.

Guarded sync

supaschema sync reconciles target history and applies pending migrations after replay, type, and RLS gates pass.

Generated outputs

TypeScript types

Types are generated from the declarative schema tree, not a live database snapshot.

Zod validators

Runtime validators turn generated database types into an application boundary without an ORM schema layer.

Actionable diagnostics

SUPA_* diagnostics explain blocked or ambiguous schema changes and point to recovery steps.

Destructive hints

Drops and incompatible changes require explicit object-level intent before SQL is generated.

Project surfaces

Coding-agent bundle

Raw public-safe prompt, rule, skill, settings, and hooks for optional AI-agent enforcement in the consuming repo.

GitHub Actions

A ready CI lane for drift, safety, package, docs, corpus, and benchmark checks.

CI drift gate

Fails pull requests when the declarative tree and generated migrations are out of sync.

Schema safety scan

Scores RLS, grant, and hygiene findings without connecting to a database.

Type-contract gate

Reports breaking generated TypeScript/Zod contract changes, with licensed standalone enforcement.

Schema contracts

Exports, diffs, pushes, and pulls JSON contracts for cross-repository drift checks.

Corpus oracle

Exercises real-world catalogs to prove reconvergence outside toy fixtures.

Provider-aware setup

Detects common PostgreSQL provider layouts while keeping adapter: "auto" provider-neutral.

Evidence

Benchmarks

Large-schema benchmark results for diff performance, correctness, and workflow cost.

Case study

A production Supabase project used to validate the migration workflow at real project scale.

Support matrix

Supported PostgreSQL object classes, failure modes, and current boundaries.

Package boundary

The exact public npm package contract and why internal maintainer tooling stays out.
Last modified on June 19, 2026