Skip to main content
Use type-contract to inspect breaking changes to the generated type surface. type-contract diffs the type shapes of two schema sources (before vs after). It does not connect to a database. supaschema sync runs deploy-blocking type-safety gates through workflow.type_safety. When a selected sync target resolves a database URL, the deploy gate compares the target’s live PostgreSQL catalog with the declarative schema tree. That package-owned deploy gate is separate from the standalone type-contract --enforce license path. type-contract --enforce requires a signed local entitlement token. Without a valid entitlement, the command prints the findings in report-only mode and exits 0; with a valid entitlement, breaking changes exit 2.

Use this when

  • A migration must not break downstream TypeScript/Zod consumers.
  • CI should gate breaking type-contract changes on a pull request.
  • You want to understand the type-safety diagnostics that sync can block before apply.

Run it

npx supaschema type-contract --from git:HEAD --to dir:database/schemas
npx supaschema type-contract --from git:HEAD --enforce
With no flags, --from defaults to git:HEAD and --to to the declarative tree.

Flags

--from
source
Previous schema source. Defaults to git:HEAD.
--to
source
New schema source. Defaults to the declarative tree.
--reporter
text | json | github | sarif
Output format. An unknown value exits 2 with an error.
--enforce
boolean
Fail (exit 2) on a breaking change in the standalone command. This CLI flag requires a license; the sync deploy-safety gate is configured separately by workflow.type_safety.

What it flags as breaking

  • a removed table;
  • a removed column;
  • a changed column type;
  • a removed enum, or a removed enum value.

Exit codes

CodeMeaning
0No breaking change, or report-only (no --enforce, or unlicensed).
2Breaking change under --enforce with a valid license.
Commercial licensing and support intake use the commercial support path.

ORM-free apps

See how generated types and validators replace ORM schema ownership.

Sync command

Run deploy-blocking type-safety and RLS-safety gates before apply.
Last modified on June 19, 2026