Skip to content

Database on Supabase

Supabase offers a free managed PostgreSQL database. The engine needs only a standard Postgres connection string and uses no Supabase feature beyond the database.

  • A Supabase account with a project, and its database password.

Open the project's connection settings in the Supabase dashboard. It offers three strings:

StringHost and portUse it
Session pooleraws-0-<region>.pooler.supabase.com:5432, user postgres.<project-ref>Yes, from any engine host.
Direct connectiondb.<project-ref>.supabase.co:5432Only when your host can reach IPv6, and with a role you created.
Transaction poolerport 6543No. It is built for short-lived serverless clients.
postgres://postgres.<project-ref>:<password>@aws-0-<region>.pooler.supabase.com:5432/postgres?sslmode=require

The engine keeps its own pool of long-lived connections, and while it applies migrations at startup it holds a session lock that the transaction pooler does not keep. The session pooler gives each engine connection a server connection of its own.

A production engine refuses to start when the database user is postgres. The session pooler's user, postgres.<project-ref>, is accepted. For a direct connection, create a role for the engine and put it in the URL.

Set the string as DATABASE_URL on the engine, through your host's secret store. Keep ?sslmode=require. Without it the driver may connect without TLS, and a production engine logs a warning on every start.

The session pooler serves a fixed number of server connections, which the dashboard shows as the pool size. Keep DATABASE_MAX_CONNECTIONS under it, such as 5, so a redeploy that runs the old and new engine side by side still fits. The default is 25.

The engine's /readyz and /healthz answer 503 while the database cannot be reached. Point your host's checks at /readyz, as each engine host page shows.

Start the engine and ask for readiness on either port:

Terminal window
curl https://<engine-url>/readyz

A 200 with "status":"ok" means the engine connected and applied its migrations.