25. Direct Postgres connection (Team & Legal Team)
When the SDK / REST / edge-functions / SQL editor / MCP aren't enough — because your stack expects a raw postgres:// URL.
Why this exists
On Free and Pro, every project shares one Postgres cluster with per-tenant schema isolation + RLS.
We don't hand out direct connection strings on those tiers — the isolation model relies on you
going through our authenticated surface (SDK, REST, MCP, edge functions with ctx.db.sql, the console SQL editor).
That covers most application code — but not tools that want to own the Postgres connection themselves:
- Payload CMS — Postgres adapter requires
DATABASE_URL - Prisma — same
- Drizzle — same
- Directus, Strapi (Postgres backend) — same
- Migration runners: Flyway, Liquibase,
node-pg-migrate,sqlx - Ad-hoc
psqlfrom your laptop
What Team unlocks
Every Team-tier project (and Legal-Team) gets its own dedicated Postgres instance in Scaleway fr-par — no shared cluster, no cross-tenant noise. That instance has its own connection string, exposed at Project → Database → Connection in the console.
Two roles: read-only (default — safe for analytics, debugging, most reads) and read/write (owner role — for migrations + writes). Both work with any Postgres client.
team.connection.url_viewed). If a URL leaks, hit
the Rotate password button — the old URL stops working within seconds.Client examples
Payload CMS
// payload.config.ts
import { postgresAdapter } from '@payloadcms/db-postgres';
export default buildConfig({
db: postgresAdapter({
pool: { connectionString: process.env.DATABASE_URL },
}),
});Prisma
// schema.prisma
datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
}Drizzle
import { drizzle } from 'drizzle-orm/postgres-js';
import postgres from 'postgres';
const client = postgres(process.env.DATABASE_URL!);
export const db = drizzle(client);psql
psql "$DATABASE_URL"Free / Pro alternatives
If you don't need direct connection, all Free/Pro projects can still work with tools that speak our SDK / REST — see chapters 4, 10, 23. When you're ready for a stack that wants raw Postgres, upgrade to Team from Project → Settings.