Skip to main content
Use this page to generate, check, type, stage, and apply or dry-run one migration. The examples use the neutral paths database/schemas and database/migrations. If install selected provider-specific paths, use the values in supaschema.config.json. The commands below use npm’s local runner. Use the matching pnpm, Yarn, or Bun runner from Installation when that manager owns the project.
1

Install

Install supaschema in the package or workspace that owns your schema files, then initialize the local project before editing the schema:
2

Write schema

Create one schema file:
database/schemas/app.sql
Your schema files are the source of truth. supaschema writes the migration.
3

Sync

Run the full workflow:
You will see output like this:
Review the generated file. It should include a lineage marker and guarded SQL:
database/migrations/20240101120000_migration.sql
4

Focused lanes

Run a focused lane only when you need to operate one step directly:
If check reports issues, review the flagged statements before applying the migration. A database URL alone does not enable apply: sync stays a dry run until config selects exactly one apply target, the migration policy permits apply, verification passes, and any remote approval is present. supaschema fails closed when it cannot prove safety.

Setup

Confirm install-time paths and setup output.

Commands

Deep-dive into diff, check, verify, and other commands.

Types

Configure and consume generated TypeScript and Zod outputs.

ORM-free apps

Use generated database contracts without adding an ORM schema layer.
Last modified on July 24, 2026