database.pizza
database.pizza is a safety-first SQL database for small applications that are built quickly — by hand, by a small team, or by AI agents. When you’re moving fast, mistakes happen. database.pizza lets you inspect available row and schema history and undo changes with scoped, reviewed SQL.
Every database runs on PizzaSQL, a SQL engine built from scratch in Go. PizzaSQL speaks SQLite-inspired SQL — it is not PostgreSQL and not a drop-in SQLite replacement. It exposes a partially PostgreSQL-compatible wire protocol, which lets some PostgreSQL clients connect, but the SQL dialect and server behavior remain SQLite-style. The compatibility notes are the honest map of what works and what does not.
Start with safety
Section titled “Start with safety”- Inspect history — review recorded row, schema, and structural changes in Change history.
- Undo and recover — roll back a mistake with scoped, reviewable SQL, and learn what recovery does not cover in Undo & recovery.
Three ways in
Section titled “Three ways in”- New here? Follow the Quickstart — five minutes from empty account to your first query.
- Writing SQL? Start with SQL at a glance and keep the compatibility notes close before generating production queries.
- Curious how it works? The Engine Internals section walks through the PizzaSQL architecture, query lifecycle, and storage model.
What you get
Section titled “What you get”Every database gives you a managed access surface plus a dashboard:
| Surface | Where | Best for |
|---|---|---|
| PostgreSQL wire protocol (partial) | db.database.pizza:5432 |
psql and tested Postgres drivers |
| HTTP query API | https://db.database.pizza/<org>/<db>/query |
Any language, serverless, and edge workloads |
| Auto-generated REST API (preview) | https://db.database.pizza/<org>/<db>/api/<table> |
Single-table CRUD without writing SQL |
| Dashboard | app.database.pizza |
Schema browsing, history, query editor, API keys, metrics |
All programmatic access is authenticated with API keys. Keys carry granular scopes — read, write, alter_table, drop_table — so you can issue a read-only key to a reporting job and a write key to an ingestion service. See API keys & permissions.
Before you connect anything: the PostgreSQL wire protocol is partial, and the managed proxy currently declines TLS (
sslmode=disable). Credentials and query traffic over the wire are therefore not encrypted on an untrusted network. Verify that your specific client, driver, or ORM works before committing to it. Read PostgreSQL protocol and Connect.
A taste
Section titled “A taste”Create a key in the dashboard, then query over HTTP:
curl -s https://db.database.pizza/acme/production/query \ -H "Authorization: Bearer pz_live_REPLACE_ME" \ -H "Content-Type: application/json" \ -d '{"sql": "SELECT 1 + 1 AS answer"}'Or with psql, using the key as the password:
PGPASSWORD='pz_live_REPLACE_ME' psql \ "postgresql://u@db.database.pizza:5432/acme%2Fproduction?sslmode=disable"Throughout these docs we use a fictional organization acme and database production, and the placeholder key pz_live_REPLACE_ME. Substitute your own values — and never paste a real key into anything you share.
Getting started
Section titled “Getting started”- Quickstart — create an org, database, and key; run your first query.
- Connect — connection strings and parameters for every client.
- Your first schema — tables, inserts, indexes, and queries.
History and recovery
Section titled “History and recovery”- Change history — how row, schema, and structural history is recorded and inspected.
- Undo & recovery — scoped undo, restore, and the limits of what recovery can (and can’t) do.
Use your database
Section titled “Use your database”- PostgreSQL clients —
psqland driver configuration, with the compatibility caveats. - HTTP query API — the managed JSON endpoint.
- JavaScript and Python — idiomatic examples.
- REST API — auto-generated CRUD endpoints.
- API keys & permissions — scopes, lifecycle, and security.
Reference and guides
Section titled “Reference and guides”- SQL reference — types, statements, expressions, functions, and constraints.
- Import & export — move data in and out.
- Errors & troubleshooting — understand failure responses.
- Limits & quotas — what counts against your plan.
The managed API vs. the engine
Section titled “The managed API vs. the engine”It’s worth drawing one distinction early. PizzaSQL, the engine, exposes its own raw HTTP API (POST /query, GET /schema/tables, and so on) and its own PostgreSQL listener. Those are internal to the platform. As a customer you never touch them directly.
Instead, you talk to the managed proxy at db.database.pizza, which sits in front of your engine instance and adds authentication, per-organization routing (<org>/<db>), scope enforcement, quotas, and metrics. The endpoints look similar to the engine’s, but they require a Bearer API key and a <org>/<db> path. The pages under Use your database document the managed surface.
Status
Section titled “Status”database.pizza is under active development. Features, quotas, and exact response shapes may change; anything unstable is flagged inline. If something here disagrees with what you observe, trust the observed behavior and open an issue.