ShipVeryFastShipVeryFast
Documentation

Swap the database or ORM

The database is standard PostgreSQL with no proprietary features, so you are never locked in. The schema is plain SQL and data access sits behind libs/supabase.ts and the typed models. This page covers two common moves.

Move to another Postgres host

Run the migration there

The migration is portable SQL. Apply it to any Postgres database (Neon, RDS, your own server).

psql "$DATABASE_URL" -f supabase/migrations/0001_initial_schema.sql

Point the client at it

Update libs/supabase.ts (or replace it with a Postgres client) and your env. If you leave Supabase Auth in place, keep its URL and keys; if not, see the auth provider cookbook.

RLS is a Supabase feature

Row Level Security is enforced by Postgres but managed by Supabase. On a plain Postgres host you keep RLS policies in SQL, but you lose the Supabase auth integration that sets the user context. Enforce tenancy in your query layer instead, or keep Supabase for auth.

Add Drizzle for typed queries

Prefer a query builder over raw SQL? Add Drizzle on top of the same database. Generate its schema from your tables and use it inside your services, while the rest of the app keeps using the typed models.

npm install drizzle-orm
npm install -D drizzle-kit
npx drizzle-kit introspect   # generate a schema from the existing tables