Supabase
zero reaches Supabase two ways, both reusing existing backends:
- Database — Supabase is managed Postgres. Use the
supabaseSQL dialect andzerotalks to it through the normalctx.SQLhandle. - Storage — Supabase object storage is S3-compatible. Use the
supabasefile-store backend and the samectx.FileStorehandle.
Database
bash
DB_DIALECT=supabase
SUPABASE_DB_PROJECT=abcdefghijklmno # -> db.<ref>.supabase.co (use this or HOST)
SUPABASE_DB_HOST=db.abcdefghijklmno.supabase.co # alternatively, set HOST directly
SUPABASE_DB_PORT=5432
SUPABASE_DB_USER=postgres
SUPABASE_DB_PASSWORD=
SUPABASE_DB_NAME=postgres
SUPABASE_DB_SSL_MODE=requireEverything you can do with Postgres works — migrations, ctx.SQL queries, Auto CRUD. See Using Postgres.
Storage
bash
FILE_STORE_BACKEND=supabase
SUPABASE_STORAGE_BUCKET=my-bucket
SUPABASE_STORAGE_ACCESS_KEY= # the "S3 Access Key" from Supabase Storage, NOT a JWT
SUPABASE_STORAGE_SECRET_KEY=
SUPABASE_STORAGE_REGION=us-east-1 # required for the SigV4 scope
SUPABASE_STORAGE_PROJECT=abcdefghijklmno # -> https://<ref>.supabase.co/storage/v1/s3ctx.FileStore is unchanged — create / get / delete / list all work. See File Store.
Caveats
- Storage auth uses the S3 Access Keys from Supabase Storage settings, not JWTs.
SUPABASE_STORAGE_REGIONis required because SigV4 signs against a region.
See the zero-filestore example.