Postgres database
Every app gets its own PostgreSQL database, backed up continuously.
- Plans
- Every plan, including the free app
- Built on
- PostgreSQL
What you get
- A PostgreSQL database for each app
- Connection pooling included
- Migrations that run before a new version goes live
- A snapshot before every migration
- Continuous backups, kept for 30 days
- An empty database of its own for each preview
- A login that cannot change the schema, when you ask for one
How it works
Each app reads one setting, DATABASE_URL, and connects with any PostgreSQL driver. Connections pass through a pooler, which shares a small set of database connections between requests. Each app has its own database and its own login, so one app cannot read another's data.
You name a migration command in the app's whisk.yaml. On each deploy, Whisk takes a snapshot, runs the command, and only then sends traffic to the new version. If the migration fails, the snapshot is restored and the previous version stays live.
With database_role: restricted the running app connects as a second login that reads and writes rows but cannot change a table or a policy; only the migration connects as the owner. That keeps row-level security in force even if the app's own code goes wrong.
Every change is backed up as it is written, so the database can be restored to any minute in the last 30 days. See backups and restore. The open-source (MIT) templates use ordinary tools: Drizzle for TypeScript, SQLAlchemy and Alembic for Python, pgx and goose for Go.
Example
A plumbing merchant runs its quotes and trade accounts in one app. When a developer adds delivery zones to the customer table, the migration runs during the deploy. Counter staff keep working on the old version until the new one is ready.
For your coding agent
database: app database_role: restricted # optional: the running app cannot change the schema migrate: "node dist/migrate.js" # a plain command: the image has no npm or shell
Read the tables before planning a change with whisk db schema --json. Connection settings are listed in the environment reference.
Related features
- Shared databaseKeep customers, products and prices once, read by every app that needs them.
- Backups and restoreEvery database is backed up continuously and kept 30 days.
- Database access for agentsYour coding agent can read and change app data, with a confirm step for big changes.