Postgres Supabase Database
Every project is a full Postgres database, the world's most trusted relational database.
- 100% portable
- Built-in Auth with RLS
- Easy to extend
- Easy to extend
What It Does
The kit uses Supabase/PostgreSQL with SQL-first schemas, generated app schemas, and generated migration bundles.
When To Use
- Adding or modifying tables/policies/functions.
- Regenerating migrations after setup changes.
- Running local database workflows.
Prerequisites
- Docker Desktop running locally.
- Supabase CLI installed.
Operational Note
Validate credentials, secrets, and runtime environment values before promoting changes to production.
How To Use
Core directories
| Path | Purpose |
|---|---|
supabase/schemas | Hand-written core kit SQL sources |
supabase/app-schemas | Hand-written core app SQL sources |
supabase/migrations | Generated merged migration file using creatorem generate-sql |
supabase/tests | SQL tests |
000-privileges.sql
001-enums.sql
...more-schema-files.sql
2026xxxxxxxx_generated_from_schemas.sql
config.toml
seed.sql
Standard flow
pnpm run supabase:start
creatorem generate-sql
pnpm run db:reset
pnpm run db:typesCommand details
creatorem generate-sql: reads app setup (.creatorem/setup.json), generatessupabase/app-schemas/*, then assembles the merged migration file insupabase/migrations/*.pnpm run db:reset: resets the local Supabase database, applies the generated SQL migration state, and rebuilds the local database from that SQL source.pnpm run db:types: run this afterdb:resetwith the Supabase Docker instance running; it generates TypeScript DB types from the current database state and refreshes Drizzle schema artifacts.
Reset local database
pnpm run db:resetMCP Context
capability: database_workflow entrypoints: - supabase/schemas/ - supabase/app-schemas/ - supabase/migrations/ - creatorem generate-sql - package.json scripts (db:reset, db:types) inputs: - sql_sources - setup_json outputs: - generated_migration_sql - updated_local_database - refreshed_types constraints: - generated migration file should not be edited manually - ordering in supabase/schemas affects merge output side_effects: - writes SQL files - mutates local db state
Agent Recipe
- Edit SQL sources or setup definitions.
- Start local Supabase (
pnpm run supabase:start) and keep it running. - Run
creatorem generate-sql. - Run
pnpm run db:reset. - Run
pnpm run db:types.
Troubleshooting
- If migration output is empty, verify SQL files exist in
supabase/schemasand/or generated app schemas. - If runtime queries fail after schema updates, regenerate types with
pnpm run db:types.
Related
Scripts
Root-level commands you will run every day.
AI Agent Rules
Canonical cross-agent execution contract for implementing features with docs + kit + examples.
How is this guide?
Last updated on 3/23/2026