Supabase is an open-source Backend-as-a-Service (BaaS) platform built on PostgreSQL, providing instant APIs, authentication, real-time subscriptions, storage, and serverless functions. It combines a full PostgreSQL database with modern BaaS features, offering a developer-friendly alternative to Firebase with the flexibility of SQL. The platform auto-generates RESTful and GraphQL APIs via PostgREST and pg_graphql, supports Row Level Security for granular access control, and provides a complete ecosystem — including Edge Functions, queues, branching, and an MCP server — for building production-ready applications. As of 2026, tables in the public schema are no longer exposed to the Data API by default; explicit GRANT statements are required for new tables.
What This Cheat Sheet Covers
This topic spans 23 focused tables and 196 indexed concepts, 111 flashcards. Below is a complete table-by-table outline of this topic, spanning foundational concepts through advanced details.
A jump-to index of every table row in this cheat sheet.
An interactive map of every table and concept in this topic.
Table 1: Database Operations
The everyday CRUD verbs you chain off supabase.from('table') — the core of working with Postgres through the auto-generated API. Each one maps to a familiar SQL operation, with rpc reaching into stored functions when you need real server-side logic. Note the recurring safety rule: update and delete demand a filter, or they touch every row.
| Method | Example | Description | |
|---|---|---|---|
await supabase.from('users').select('*') | • Fetches rows from a table • use .select('col1, col2') for specific columns. | ||
await supabase.from('users').insert({ name: 'John', email: 'j@x.com' }) | • Inserts one or more rows • accepts single object or array • chain .select() to return inserted data. | ||
await supabase.from('users').update({ name: 'Jane' }).eq('id', 5) | • Modifies existing rows • requires a filter to avoid updating all rows. | ||
await supabase.from('users').upsert({ id: 5, name: 'Jane' }) | • Inserts or updates based on primary key or unique constraint • use onConflict option to specify the column. | ||
await supabase.from('users').delete().eq('id', 5) | • Removes rows • requires filter to avoid deleting all rows • chain .select() to return deleted data. | ||
await supabase.rpc('increment_view_count', { post_id: 42 }) | • Calls a PostgreSQL stored function • allows complex server-side logic without exposing raw SQL. |