Supabase
Quickback generates PostgreSQL schemas with Row Level Security for Supabase. Database-level security with Supabase Auth integration.
Quickback supports Supabase as a deployment target, generating PostgreSQL schemas with Row Level Security (RLS) policies that enforce your firewall configuration at the database level.
Why Supabase?
- Full PostgreSQL — Advanced queries, joins, PostGIS, full-text search
- Database-Level Security — RLS policies enforce access even if API is bypassed
- Integrated Auth — Supabase Auth with JWT claims for RLS
- Real-time — Postgres Changes for live updates
- Managed Infrastructure — Automatic backups, scaling, monitoring
Configuration
import { defineConfig, defineRuntime, defineDatabase, defineAuth } from "@quickback/compiler";
export default defineConfig({
name: "my-app",
providers: {
runtime: defineRuntime("supabase"),
database: defineDatabase("supabase"),
auth: defineAuth("supabase-auth"),
},
});Key Difference from Neon
| Feature | Supabase | Neon |
|---|---|---|
| Auth function | auth.uid() | auth.user_id() |
| Auth provider | Supabase Auth | Neon Authorize + Better Auth |
| Users table | auth.users | public.users (Better Auth) |
Row Level Security
Quickback generates RLS policies from your firewall config:
firewall: {
organization: {},
owner: { mode: 'optional' }
}-- Generated policy
CREATE POLICY "documents_select" ON documents FOR SELECT
USING (
organization_id = get_active_org_id()
AND (has_any_role(ARRAY['admin']) OR user_id = auth.uid())
);Firewall Patterns
Organization-Scoped:
CREATE POLICY "projects_select" ON projects FOR SELECT
USING (organization_id = public.get_active_org_id());User-Scoped:
CREATE POLICY "preferences_select" ON preferences FOR SELECT
USING (user_id = auth.uid());Defense in Depth
All generated policies include a deny policy for anonymous users:
CREATE POLICY "tablename_deny_anon" ON tablename FOR ALL
TO anon
USING (false);Generated Helper Functions
| Function | Purpose |
|---|---|
get_active_org_id() | Returns user's active organization from user_sessions |
has_any_role(roles[]) | Checks if user has any specified role |
has_org_role(role) | Checks for a specific role |
is_org_member() | Checks org membership |
get_user_role() | Returns user's role in active org |
Generated Files
supabase/
├── migrations/
│ ├── 0100_create_rls_helpers.sql
│ ├── 0101_create_rls_policies.sql
│ └── 0102_create_audit_triggers.sql
src/
├── db/
│ └── schema.ts
└── lib/
└── supabase.tsGetting Started
- Install the Supabase CLI
- Configure your Quickback project for Supabase
- Run
quickback compile - Push migrations with
supabase db push
Neon
Quickback generates PostgreSQL schemas with Row Level Security for Neon. Database-level security with Neon Authorize and Better Auth.
Cloud Compiler
The hosted Quickback compiler turns your definitions into a complete backend. Learn about architecture, authentication, and how the CLI communicates with the cloud.