Supabase

Database development

Work with migrations, generated types, seed data, and pgTAP checks.

Local workflow

Schema changes belong in timestamped migrations. Reset the local database to replay migrations and seed data, then regenerate TypeScript types.

bash
1pnpm db:start 2pnpm --filter database exec supabase db reset 3pnpm --filter database gen-types-local

RLS first

Add Row Level Security policies with every new table. Test both the allowed path and a cross-user denial path. Avoid relying on filters in application code for tenant isolation.

Test both sides of the boundary

Every tenant-scoped feature should cover at least these cases:

  1. A member can perform the intended operation.
  2. A different user cannot read or mutate that data.
  3. A restricted role cannot perform privileged mutations.

Consistency RPCs

Use the repository’s atomic RPCs for operations such as workspace creation, relationship replacement, media deletion claims, and feedback upvotes. They serialize the parts of a workflow that cannot be made safe with independent Data API calls.

Still stuck? Share feedback about the documentation.