| name | supabase-common-workflows |
| description | Use when implementing common Supabase patterns or quick reference for typical operations |
Supabase Common Workflows
Quick reference cookbook for common Supabase operations. This skill provides step-by-step recipes for typical database tasks.
Core Workflows
1. Create Table with RLS (Complete Recipe)
CREATE TABLE public.table_name (
id TEXT PRIMARY KEY DEFAULT generate_id('prefix'),
organization_id TEXT NOT NULL REFERENCES public.organizations(id) ON DELETE CASCADE,
name TEXT NOT NULL,
description TEXT,
created_at TIMESTAMPTZ DEFAULT now(),
updated_at TIMESTAMPTZ DEFAULT now()
);
CREATE INDEX idx_table_organization_id ON public.table_name(organization_id);
ALTER TABLE public.table_name ENABLE ROW LEVEL SECURITY;
CREATE POLICY "Organization members can view items"
ON public.table_name FOR SELECT
USING (
EXISTS (
public.organization_members
organization_members.organization_id table_name.organization_id
organization_members.user_id ( auth.uid())
)
);
POLICY "Organization members can create items"
public.table_name
(
(
public.organization_members
organization_members.organization_id table_name.organization_id
organization_members.user_id ( auth.uid())
)
);
POLICY "Organization members can update items"
public.table_name
(
(
public.organization_members
organization_members.organization_id table_name.organization_id
organization_members.user_id ( auth.uid())
)
);