supabase-usage
Original:🇺🇸 English
Translated
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.
7installs
Added on
NPX Install
npx skill4agent add fcakyon/claude-codex-settings supabase-usageTags
Translated version includes tags in frontmatterSKILL.md Content
View Translation Comparison →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:
- - List all tables in the database
mcp__supabase__list_tables - - Get schema for a specific table
mcp__supabase__get_table_schema - - Run read-only SQL queries
mcp__supabase__execute_sql
Workflow:
- Start with to understand database structure
list_tables - Use to inspect columns and types
get_table_schema - Use for custom queries (read-only)
execute_sql
Best Practices
DO
- ✓ Enable RLS on all public tables
- ✓ Use in RLS policies for performance
(select auth.uid()) - ✓ Add indexes on RLS-checked columns
- ✓ Specify roles with in policies
TO authenticated - ✓ Use for foreign keys to auth.users
on delete cascade - ✓ Use cursor-based pagination for large datasets
- ✓ Select only needed columns: not
.select('id, name').select('*')
DON'T
- ✗ Store sensitive data without RLS
- ✗ Use directly in policies (use
auth.uid())(select auth.uid()) - ✗ Create policies without specifying roles
- ✗ Forget indexes on frequently filtered columns
- ✗ Use offset pagination for deep pages (>1000 rows)
- ✗ Expose auth.users directly via API (use public profiles table)
Quick Reference
Common Filters
| Filter | JavaScript | Python |
|---|---|---|
| Equals | | |
| Not equals | | |
| Greater than | | |
| Greater or equal | | |
| Less than | | |
| Less or equal | | |
| Pattern match | | |
| In list | | |
| Is null | | |
| OR | | |
Auth Tables Quick Reference
| Table | Key Columns |
|---|---|
| id, email, phone, created_at, last_sign_in_at, raw_user_meta_data |
| id, user_id, created_at, updated_at |
| id, user_id, provider, identity_data |
RLS Policy Template
sql
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/updateAdditional Resources
For detailed patterns and code examples, consult:
- - Authentication with JS/Python SDK, user profiles
references/auth.md - - Row Level Security policies and performance tips
references/rls.md - - Table relationships and nested queries
references/relationships.md - - Filtering, pagination, counting, indexes
references/query-patterns.md