supaschema types reads declarative PostgreSQL files and emits TypeScript database types plus runtime Zod validators from the same schema model used for migrations.
Use this when
- A pull request changes SQL and TypeScript together.
- Database introspection cannot see the new schema yet.
- You want runtime validators generated from the same source as migrations.
- You want a typed, validated application boundary without adding an ORM schema layer.
- You want generated application contracts without adding a provider-specific or ORM schema layer.
Do this
Generate types from the configured schema tree:supaschema diff refreshes configured TypeScript and Zod outputs after writing a migration, so the schema, migration, and app types can be reviewed together.
Use the generated helpers as the application contract:
Verify
Commit generated outputs when your project reviews them:Related
Types command
See type and Zod output flags.
Configuration
Set default output paths in config.
ORM-free apps
Use generated outputs as the application contract.
CI recipe
Keep generated files checked in CI.

