Agents use .single() for lookups and crash on the not-found case. .single() throws when zero rows (or more than one) come back. When missing data is a normal outcome, maybeSingle returns null…
Agents add a deleted_at column and forget the policies, so trashed rows still show up. The complete pattern: the column, policies that filter it on every operation, and a purge job for real deletion…
Uploads fail with a 400 and agents blame the network. The three causes in order of likelihood: no INSERT policy on storage.objects for the caller's role, the bucket does not exist or the name is…
Agents create buckets public for convenience and expose user uploads to the world. Decide per bucket: public only for genuinely public assets, private for everything user-scoped, with RLS policies…
Storage policies confuse agents because the table is storage.objects, not their table. The pattern: policies on storage.objects keyed by bucket_id, with auth.uid() matched against the owner or the…
Agents either make buckets public to share files or generate signed URLs that never expire. The middle path: private bucket, createSignedUrl with a short expiry for downloads, createSignedUploadUrl…
Shows how to fix supabase data seeding: idempotent seed scripts that never run as migrations. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.
Agents build multi-tenant apps with a tenant_id column and no enforcement, or with policies that leak across tenants. The complete pattern: orgs table, memberships table, tenant id on every row, and…
Shows how to fix node.js OSS mem0: Supabase, Redis, and pgvector setup all fail. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.
SvelteKit agents either skip SSR auth entirely or share one client across requests. The current docs pattern: createServerClient per request in hooks.server.ts with the SvelteKit cookie interface,…
iOS agents configure the Supabase client but not the return path: the callback URL scheme in Info.plist and the dashboard redirect list. OAuth completes in the browser and the session never makes it…
Shows how to fix supabase database webhooks: trigger HTTP calls on row changes without polling. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.
Agents upload large files with a single PUT and hit timeouts and size limits. The tus resumable protocol splits the upload into chunks that survive network drops and resume where they stopped.
Shows how to fix supabase Edge Function CORS failures: answer OPTIONS before your code runs. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.
Guide Supabase branching: preview branches for schema changes, merge with the CLI: Agents that run migrations straight at production learn this the hard way. # Supabase branching: a staging database…
Shows how to fix running prisma migrate dev against Supabase with multiSchema throws error: `db error: ERROR: cannot drop table. Use it when you hit this exact problem. Skip it when your error…
Shows how to fix supabase Edge Functions: anon key for user work, service role for admin work, verify_jwt off for webhooks. Use it when you hit this exact problem. Skip it when your error message or…
Guide Next.js App Router + Supabase: browser client for Client Components, fresh server client per request: Server Components run per request with per-request cookies, so a singleton leaks sessions…
Guide Next.js Pages Router + Supabase: auth-helpers is deprecated, build the server client per request with: Install # Next.js Pages Router + Supabase without the deprecated auth-helpers Agents keep…
Guide Next.js proxy.ts keeps Supabase users signed in: refresh there, verify with getClaims, never getSession: Create the proxy file with an # Next.js proxy.ts: the session refresh that keeps users…
Guide Nuxt 3 + Supabase: server routes and server components need a request-scoped client: # Nuxt 3 + Supabase: do not use the browser client on the server The Nuxt Supabase module (or a hand-rolled…
Shows how to fix supabase email templates: customize per email type and test the variables before launch. Use it when you hit this exact problem. Skip it when your error message or symptom looks…
Guide Supabase OAuth redirect_uri_mismatch: the provider console and Supabase disagree: # redirect_uri_mismatch: fix it in the provider console This error is issued by Google, GitHub, or whichever…
Guide Supabase onAuthStateChange: the infinite sign-in loop agents write, and the guard: # onAuthStateChange: stop writing infinite auth loops onAuthStateChange fires on. Use this when you hit…
Shows how to fix flutter + Supabase: initialize once in main, deep links registered, PKCE is the default. Use it when you hit this exact problem. Skip it when your error message or symptom looks…