Postgres
FluxNow provisions a managed Postgres database for your app. Postgres is on by default — you get one unless you explicitly opt out.
What you get
Section titled “What you get”- Postgres 18 with pgvector for vector embeddings and PostGIS for geospatial queries
- Automatic provisioning — no setup required
- Daily backups with 7-day retention
Environment variables
Section titled “Environment variables”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:
| Variable | For |
|---|---|
DATABASE_URL | The full connection string — most clients (Prisma, Drizzle, SQLAlchemy, pg, …) |
PGHOST · PGPORT · PGUSER · PGPASSWORD · PGDATABASE | libpq discrete form — psql, pgx, node-postgres, pg gem |
PGSSLMODE | disable (in-cluster traffic is plaintext, a single hop) |
POSTGRES_HOST · POSTGRES_PORT · POSTGRES_USER · POSTGRES_PASSWORD · POSTGRES_DB | NestJS / TypeORM / @nestjs/config convention |
POSTGRES_URL | Vercel Postgres-style url clients |
DIRECT_URL | Prisma direct (non-pooled) connection for migrations |
JDBC_URL · JDBC_DATABASE_URL | JVM / 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.
Preview environments
Section titled “Preview environments”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.
Migrations
Section titled “Migrations”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):
spec: runtime: node release: bun run db:migrateSee Release command (migrations) for how it runs, auto-detection, and failure behavior.
Enabling / disabling Postgres
Section titled “Enabling / disabling Postgres”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:
db: enabled: false