Skip to content

Postgres

FluxNow provisions a managed Postgres database for your app. Postgres is on by default — you get one unless you explicitly opt out.

  • Postgres 18 with pgvector for vector embeddings and PostGIS for geospatial queries
  • Automatic provisioning — no setup required
  • Daily backups with 7-day retention

FluxNow injects the connection details into your container at deploy time under a broad set of aliases, so any driver or framework works unchanged. You never set these yourself — read them straight from the environment:

VariableFor
DATABASE_URLThe full connection string — most clients (Prisma, Drizzle, SQLAlchemy, pg, …)
PGHOST · PGPORT · PGUSER · PGPASSWORD · PGDATABASElibpq discrete form — psql, pgx, node-postgres, pg gem
PGSSLMODEdisable (in-cluster traffic is plaintext, a single hop)
POSTGRES_HOST · POSTGRES_PORT · POSTGRES_USER · POSTGRES_PASSWORD · POSTGRES_DBNestJS / TypeORM / @nestjs/config convention
POSTGRES_URLVercel Postgres-style url clients
DIRECT_URLPrisma direct (non-pooled) connection for migrations
JDBC_URL · JDBC_DATABASE_URLJVM / Spring / JDBC clients

Most apps just read DATABASE_URL:

import { Pool } from "pg";
const pool = new Pool({ connectionString: process.env.DATABASE_URL });

You do not create the database, generate a password, or paste a connection string anywhere — provisioning does all of that and wires it into your app. See the Environment Variables reference for every service’s variables in one place.

Each pull request preview environment gets its own isolated Postgres database. The schema is branched from staging at preview creation time, so your migrations and seed data are available in previews from the start.

Run migrations with the release command — a pre-deploy step that runs against the target environment’s database before the new version takes traffic. Set it with spec.release in fluxnow.yaml (or let FluxNow auto-detect it from a Procfile or your framework):

fluxnow.yaml
spec:
runtime: node
release: bun run db:migrate

See Release command (migrations) for how it runs, auto-detection, and failure behavior.

Postgres is on by default. To turn it off, set db.enabled: false in fluxnow.yaml — at the top level for a single service, or under an app’s spec in a monorepo:

fluxnow.yaml
db:
enabled: false