Skip to main content
Use the library API when you want supaschema behavior inside your own script, test, or tool. Everything the CLI does is available as typed ESM exports.

Core pipeline

Operations and state

Pass { postgrestVersion: "12" } as the second argument to generateDatabaseTypes to include Database.__InternalSupabase.PostgrestVersion; omit it when the generated contract should not own a PostgREST version.

Support utilities

All exports ship TypeScript types, including SchemaModel, MigrationPlan, SyncOptions, and CorpusReport.

Public vs internal surface

The exports above are the semver-stable public library API. Lower-level helpers that the CLI and tests share internally are not part of the public package surface and have no published entry point. These include disposable-database lifecycle, raw apply, and catalog fingerprinting (src/database/admin.ts), migration-unit grouping and Supabase-CLI command building (src/migrations/runners.ts), migration-file version parsing (src/migrations/status.ts), and deploy-safety/type-safety internals (src/pipeline/deploy-safety.ts, src/pipeline/type-safety.ts). They may change or be removed in any release. Use the documented pipeline exports (verifyMigration, syncMigrations, migrationsStatus) instead of reaching for them. For generated signatures, run npm run docs:api in the repository.
Last modified on July 24, 2026