Databases

Each database you provision is a real, isolated Postgres instance you can connect to from your own code.

Provisioning

In the SQL Editor sidebar, click the + next to Databases. We provision a dedicated Postgres project for you, generate a strong random password, and return credentials once it's healthy.

Provisioning is async — the row starts in Provisioning state and flips to Healthy within ~30s. The sidebar polls every 15 seconds, so you don't need to refresh.

Credentials

On any Healthy database, click the key icon to reveal:

  • Connection string — IPv4-friendly pooler URL on port 5432, ready to drop into DATABASE_URL.
  • Project URL — the REST/Realtime endpoint base.
  • Anon key — public client-side key, safe to ship in a browser.
  • Service key — server-only key with elevated privileges. Never expose it to a client.
Note:Treat the service key like a password. Anyone with it has full access to your database.

Connecting from your code

Use the connection string with any standard Postgres client:

// Node — postgres-js
import postgres from "postgres";
const sql = postgres(process.env.DATABASE_URL, { ssl: "require" });
const rows = await sql`select * from notes order by created_at desc`;

Idle auto-pause

To keep resource usage honest, any database with no SQL activity for 14 days is automatically paused. Running a query — from the SQL Editor or your own code — refreshes its last_used_at timestamp.

Paused databases can be resumed from the Supabase project dashboard; we'll add an in-app resume button shortly.

Deleting a database

The trash icon next to each database row tears down the underlying Postgres project and removes the record. This is irreversible — all rows, schemas, and credentials are destroyed.