Supabase Postgres Best Practices
Production Postgres schema design, Row-Level Security (RLS) policies, indexing, and Supabase Edge Function guidelines.
Sample Trigger Prompts
“Review our Postgres migrations for missing foreign-key indexes and slow RLS policy subqueries.”
“Design a multi-tenant Supabase schema with strict Row-Level Security policies.”
Overview
Most Supabase production incidents stem from slow Row-Level Security (RLS) predicates, missing composite indexes, or leaky service-role keys. supabase-postgres-best-practices embeds Supabase’s own Postgres optimization playbook directly into your coding agent.
Key Capabilities
- RLS Performance & Safety: Wraps
auth.uid()calls in(select auth.uid())for initPlan caching and verifies every public table enables RLS. - Indexing & Query Plans: Guides partial indexes, GIN indexes for JSONB/full-text search, and N+1 elimination.
- Pooling & Auth Hygiene: Distinguishes Supavisor transaction pooling ports from direct migration connections and keeps
service_rolekeys server-only.
Best Paired With
- Cloudflare Platform for edge API workers querying Postgres
- Trail of Bits Security Audit for multi-tenant authorization reviews
More in Cloud, Infra & APIs
Browse category →Cloudflare Platform
Official Cloudflare skills for Workers, Durable Objects, D1, R2, KV, Workers AI, Vectorize, and Pages deployment.
$ npx skills add cloudflare/skillsStripe Best Practices
Official Stripe integration skill covering Checkout, PaymentIntents, webhook signature verification, and Billing APIs.
$ npx skills add stripe/ai