Supabase

Hosted PostgreSQL + auth — use Supabase as your Postgres backend with SQLx in Resuma Flow.

Setup

# .env
DATABASE_URL=postgres://postgres.[ref]:[password]@aws-0-[region].pooler.supabase.com:6543/postgres

# Cargo.toml
sqlx = { version = "0.8", features = ["runtime-tokio", "postgres", "macros", "migrate"] }

Loader with Supabase Postgres

#[load]
async fn posts(_req: &FlowRequest) -> Vec<Post> {
    sqlx::query_as!(Post, "SELECT id, title FROM posts ORDER BY id DESC LIMIT 20")
        .fetch_all(db::pool())
        .await
        .unwrap_or_default()
}

Supabase Auth (optional)

Verify JWT from Authorization: Bearer in middleware using Supabase JWT secret, or use Supabase only as managed Postgres and handle auth with Flow auth.

See also SQLx integration for loaders, submits, and migrations.