Configure your Supabase Database
Environment | Characteristics | Considerations |
---|---|---|
Dev | Safe for experimentation, can be reset | Not for real user data |
Production | Contains real user data | Test all changes in dev first |
db/schema/index.ts
.Pattern | Use Cases | Benefits | When to Use |
---|---|---|---|
Direct Drizzle in Server Actions | Server components, form submissions | Type safety, best performance | When you need the fastest queries and don’t need loading states |
React Query + Server Actions | Client UI with loading states | Caching, loading states | When users need to see loading spinners and you want to cache data |
Supabase Client | Client-side auth, storage | RLS security, simple API | When you need real-time updates or client-side authentication |
db/schema/
files and update RLS policies in db/rls.sql
db/schema/
db/rls.sql
bun run db:init
bun run db:studio
bun run db:drop
bun run db:generate
bun run db:push
bun run db:rls
bun run db:seed