Skip to main content
The Database primitive is managed Postgres, backed by a fullstack app’s managed backend. Naive owns the credentials and injects them — you run SQL, read/write rows through a REST interface, and apply migrations without ever holding a database key.
Database (and Storage, Edge Functions, Auth) operate on a fullstack app’s managed backend. Create one first: naive.apps.create({ name, type: "fullstack" }). These are curated surfaces over the same scoped backend proxy that powers the apps primitive.

Two ways to use it

Database works for your own project and for each of your end-users’ projects, using Naive’s multi-tenancy:
When a user owns exactly one fullstack app, the call auto-resolves it. With multiple apps, pass { appId }.

SQL

REST CRUD

Filters use the REST query syntax. Runs with the service-role key (RLS bypassed) — treat it as admin access.

Schema changes

migrate runs DDL against the database (works on any plan). The tracked database/migrations endpoint is gated to approved orgs — reach it directly through the backend proxy (.../supabase/proxy/v1/projects/{ref}/database/migrations) where your org has access.

REST

Your own project is reached at /v1/apps/<app-id>/…; an end-user’s project is /v1/users/<user-id>/apps/<app-id>/…. The SDK picks the right path automatically (naive.database vs naive.forUser(id).database). See the Database API reference.

Billing

Free — no per-operation credit cost. The underlying managed backend comes with the fullstack app. Account Kits can gate the database primitive per user.