Docs / Build / Database

Database

Each project environment can have one managed PostgreSQL database. Usually you never create it: deploying an app that needs a database provisions one and injects DATABASE_URL.

What you see

Simple: health, number of tables, size, open connections.

Advanced: engine version, host, port, database and user names, the SQL editor, and deletion. The password is never shown — your app receives it inside DATABASE_URL.

Variables FASTBASE injects

DATABASE_URL, POSTGRES_URL, PGHOST, PGPORT, PGUSER, PGPASSWORD, PGDATABASE.

Using it

Use any PostgreSQL client or ORM with DATABASE_URL — Prisma, Drizzle, pg, Knex. That is the recommended path for application code.

For quick server-side access without a driver, the SDK data API works with the secret key:

const products = await fastbase.from("products").select().order("name")

Migrations

Migrations run on every deployment, before the new version receives traffic. See Deploy your first app. A failed migration fails the deployment; the previous version stays live.

SQL editor

Under Advanced. Statements run as the project’s own database role (never as an administrator), stop after 10 seconds, return at most 500 rows, and are recorded in the audit log.

Backups

  • Automatic: once a day, the newest 7 are kept.
  • Manual: Back up now. Manual backups are kept until the database is deleted.
  • Restore: replaces the current data with the backup. Requires an admin and typing the project address.

Know the limits. With the built-in database provider a backup is a snapshot stored on the same server as the database. It protects against mistakes (a bad migration, an accidental delete). It does not protect against losing that server. Taking or restoring a snapshot disconnects the app from the database for a moment. Off-site backups and point-in-time recovery arrive with a managed-cloud database provider.

Isolation

Every database has its own login role, which owns only that database. Other projects’ databases — and FASTBASE’s own — refuse its connections.

Deleting

Advanced → Delete database removes the database, all rows and all backups. It needs an admin and the project address typed back. The AI Engineer and the MCP server cannot do this without the same confirmation.