supaschema init; it discovers established project paths, writes safe defaults, and installs or merges the active coding-agent surfaces. Zero-flag commands then use the generated config.
It reads PostgreSQL schema intent from SQL files and existing migrations, compares it with another schema source, renders replay-safe migration SQL, regenerates TypeScript types and Zod validators, and can apply pending migrations through guarded targets. The declarative tree owns final schema shape; existing migrations provide source intent for operational facts such as backfills, Vault references, and workload-derived indexes. It removes the need for an ORM schema layer, Docker, or a shadow database in the schema workflow.
Published large-schema benchmarks keep the speed claim measurable: at 1,000 tables, supaschema remains in the single-digit-second lane while the compared Supabase CLI diff engines depend on database-backed replay. See Benchmarks for the methodology, environment, accuracy, and replay-safety results.
When it helps
- Your repository should be the source of truth for PostgreSQL schema changes.
- You want migrations that can be retried safely after a failed deploy.
- You need policy, type, and generated-output changes visible before a database catches up.
- You want typed, validated application boundaries without making an ORM the schema owner.
- You use plain PostgreSQL or a hosted provider such as Supabase, Neon, RDS/Aurora, Cloud SQL, AlloyDB, or Azure PostgreSQL.
Workflow
supaschema schema workflow
supaschema sync renders the migration, checks replay safety, regenerates contracts, stages the schema closure when Git is available, runs source-model safety gates, and runs the guarded apply or dry-run lane for one configured target. diff, check, types, stage, and apply remain available for focused operation.
For detailed performance, accuracy, and replay-safety results, see Benchmarks.
Start here
Install
Add supaschema to the project that owns your schema files.
Quickstart
Generate and check one migration from one schema file.
Configure
Set schema paths, sources, migrations, environments, and workflow defaults.
ORM-free apps
Use generated TypeScript and Zod contracts without making an ORM the schema
owner.

