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:{ appId }.
SQL
REST CRUD
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
/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
Queries and other per-operation calls are free — there is no per-request credit cost. The underlying managed Postgres project, however, costs us a recurring vendor fee for as long as it exists, so a provisioned database is duration-metered (database_usage) while it is ready — the same way compute and hosted runtime are billed by time. That meter is not currently charging: it ships at a rate of 0, and the expected ~0.3 credits/hour per managed Postgres project will be announced before it starts. naive down tears it down and stops the meter; your data persists until then. Account Kits can gate the database primitive per user.