supabase-usage
This skill should be used when user asks to "query Supabase", "list Supabase tables", "get Supabase schema", "search Supabase records", "check Supabase database", "Supabase auth", "Supabase authentication", "RLS policy", "row level security", "Supabase foreign key", "table relationships", "Supabase join", "Supabase filter", "Supabase pagination", or needs guidance on Supabase database patterns, auth flows, RLS policies, or query best practices.
- License 许可
- MIT
- 最近更新
- 2026-03-30
- Stars
- ★ 2
- Forks
- 0
01 前言 Front Matter
- name
- supabase-usage
- references
- [ "references/auth.md", "references/rls.md", "references/relationships.md", "references/query-patterns.md" ]
- description
- This skill should be used when user asks to "query Supabase", "list Supabase tables", "get Supabase schema", "search Supabase records", "check Supabase database", "Supabase auth", "Supabase authentication", "RLS policy", "row level security", "Supabase foreign key", "table relationships", "Supabase join", "Supabase filter", "Supabase pagination", or needs guidance on Supabase database patterns, auth flows, RLS policies, or query best practices.
02 资源文件 4
- 参考文档references/auth.md2.2 KB
- 参考文档references/query-patterns.md3.9 KB
- 参考文档references/relationships.md1.8 KB
- 参考文档references/rls.md2.4 KB
03 SKILL.md 正文
Supabase Database Patterns
Patterns for working with Supabase databases including Auth, Row Level Security, table relationships, and query best practices.
Overview
- MCP Tools: Query and explore database structure
- Authentication: User management, sessions, auth tables
- Row Level Security: Policy patterns for data access control
- Table Relationships: Foreign keys, joins, nested queries
- Query Patterns: Filtering, pagination, performance
MCP Tools
Available tools for database exploration:
mcp__supabase__list_tables- List all tables in the databasemcp__supabase__get_table_schema- Get schema for a specific tablemcp__supabase__execute_sql- Run read-only SQL queries
Workflow:
- Start with
list_tablesto understand database structure - Use
get_table_schemato inspect columns and types - Use
execute_sqlfor custom queries (read-only)
Best Practices
DO
- Enable RLS on all public tables
- Use
(select auth.uid())in RLS policies for performance - Add indexes on RLS-checked columns
- Specify roles with
TO authenticatedin policies - Use
on delete cascadefor foreign keys toauth.users - Use cursor-based pagination for large datasets
- Select only needed columns:
.select('id, name')not.select('*')
DON'T
- Store sensitive data without RLS
- Use
auth.uid()directly in policies (use(select auth.uid())) - Create policies without specifying roles
- Forget indexes on frequently filtered columns
- Use offset pagination for deep pages (>1000 rows)
- Expose
auth.usersdirectly via API (use a public profiles table)
Quick Reference
Common Filters
| Filter | JavaScript | Python |
|---|---|---|
| Equals | .eq('col', val) |
.eq("col", val) |
| Not equals | .neq('col', val) |
.neq("col", val) |
| Greater than | .gt('col', val) |
.gt("col", val) |
| Greater or equal | .gte('col', val) |
.gte("col", val) |
| Less than | .lt('col', val) |
.lt("col", val) |
| Less or equal | .lte('col', val) |
.lte("col", val) |
| Pattern match | .ilike('col', '%val%') |
.ilike("col", "%val%") |
| In list | .in('col', [a,b]) |
.in_("col", [a,b]) |
| Is null | .is('col', null) |
.is_("col", "null") |
| OR | .or('a.eq.1,b.eq.2') |
.or_("a.eq.1,b.eq.2") |
Auth Tables Quick Reference
| Table | Key Columns |
|---|---|
auth.users |
id, email, phone, created_at, last_sign_in_at, raw_user_meta_data |
auth.sessions |
id, user_id, created_at, updated_at |
auth.identities |
id, user_id, provider, identity_data |
RLS Policy Template
create policy "policy_name" on table_name
to authenticated -- or anon, or specific role
for select -- select, insert, update, delete, or all
using ( (select auth.uid()) = user_id )
with check ( (select auth.uid()) = user_id ); -- for insert/update
Additional Resources
For detailed patterns and code examples, consult:
references/auth.md- Authentication with JS/Python SDK, user profilesreferences/rls.md- Row Level Security policies and performance tipsreferences/relationships.md- Table relationships and nested queriesreferences/query-patterns.md- Filtering, pagination, counting, indexes
04 同仓库更多 Skills
workflow
Vercel Workflow DevKit (WDK) expert guidance. Use when building durable workflows, long-running tasks, API routes or agents that need pause/resume, retries, step-based execution, or crash-safe orchestration with Vercel Workflow.
verification
Full-story verification — infers what the user is building, then verifies the complete flow end-to-end: browser → API → data → response. Triggers on dev server start and 'why isn't this working' signals.
vercel-storage
Vercel storage expert guidance — Blob, Edge Config, and Marketplace storage (Neon Postgres, Upstash Redis). Use when choosing, configuring, or using data storage with Vercel applications.
vercel-services
Vercel Services — deploy multiple services within a single Vercel project. Use for monorepo layouts or when combining a backend (Python, Go) with a frontend (Next.js, Vite) in one deployment.
vercel-sandbox
Vercel Sandbox guidance — ephemeral Firecracker microVMs for running untrusted code safely. Supports AI agents, code generation, and experimentation. Use when executing user-generated or AI-generated code in isolation.
vercel-queues
Vercel Queues guidance (public beta) — durable event streaming with topics, consumer groups, retries, and delayed delivery. $0.60/1M ops. Powers Workflow DevKit. Use when building async processing, fan-out patterns, or event-driven architectures.