Hosted PostgreSQL and MySQL
Supabase, PlanetScale, Cloud SQL, AlloyDB, RDS, and Aurora each take a connection string in DATABASE_URL, and differ in their ports, poolers, and TLS settings.
The settings each service asks for
Supabase, PlanetScale, Cloud SQL, AlloyDB, RDS, and Aurora run PostgreSQL or MySQL, so examples/postgres connects to any of them once DATABASE_URL holds the service's connection string. They differ in the settings the table lists, as their documentation gave them in October 2026. sqlx built with its tls-rustls feature checks a server's certificate against the Mozilla list of root certificates, and reads sslrootcert as the path of a certificate file.
| Service | Connection | TLS | Note |
|---|---|---|---|
| Supabase (PostgreSQL) | postgresql://postgres:PASSWORD@db.REF.supabase.co:5432/postgres, over IPv6 unless the project has the IPv4 add-on. The session pooler takes user postgres.REF on port 5432 | Off by default. sslmode=verify-full with sslrootcert naming the CA file from the database settings | The transaction pooler on port 6543 does not support prepared statements, and sqlx prepares every query by default, so use the direct connection or the session pooler |
| PlanetScale (PostgreSQL) | Port 5432 reaches PostgreSQL, and 6432 reaches PgBouncer in transaction mode | Required: sslmode=verify-full | PlanetScale's own string adds sslrootcert=system, a word sqlx would read as a file name, so leave it out |
| PlanetScale (Vitess, MySQL) | A mysql:// URL with sqlx's mysql feature | Clients without full TLS support do not connect | Foreign keys are a setting of the database, and work only while it is unsharded |
| Cloud SQL, AlloyDB (from Cloud Run) | The Unix socket under /cloudsql/INSTANCE_CONNECTION_NAME, as postgres://USER:PASSWORD@/DB?host=/cloudsql/INSTANCE_CONNECTION_NAME. sqlx adds the .s.PGSQL.5432 that PostgreSQL's socket name ends in | The socket is encrypted without a setting | Add the instance to the Cloud Run service's Cloud SQL connections |
| RDS, Aurora | A password, or an IAM token from aws-sdk-rds's auth_token::AuthTokenGenerator | sslmode=verify-full with the AWS CA file | A token lasts 15 minutes, so each new connection of the pool needs a fresh one |
Pools on Vercel
Vercel runs one process per instance of a function and adds instances as requests grow, and each process opens its own pool, so the connections to the database multiply with the instances. Keep max_connections small there, and connect through the service's pooler where it has one that supports prepared statements. Vercel's own helper for this, attachDatabasePool, is a Node.js API.
Next
- Storing data builds the pool from
DATABASE_URLand coversPgListenerbehind a pooler. - The database each host can reach covers Cloudflare's Hyperdrive, which hands a worker a connection string for PostgreSQL.