Skip to main content
Every database is a dedicated Neon Postgres instance — isolated, scale-to-zero, with pooled and direct connections. Ask the AI to create one and it handles provisioning and credentials.

Creating a database

Tell the AI to create a database and give it a name. It provisions a Neon project and stores credentials in the space’s secrets vault.
AI tool: create_database { name: "my-database" }

Connecting to an app

Ask the AI to connect a database to an app. It injects connection env vars into the app’s .env and sets up a database() wrapper.
AI tool: connect_app_to_database { appId: "...", databaseId: "..." }
For multiple databases on one app, the AI uses named connections — each gets its own set of env vars (e.g. VITE_ANALYTICS_DATABASE_URL).

Migrations

Schema changes go in SQL files in the app repo (e.g. migrations/001_create_todos.sql). Committing triggers execution automatically. If realtime sync is enabled, sync rules update too.

Enabling realtime sync

Ask the AI to enable sync on a database. It deploys a PowerSync instance on Fly.io, giving your app local-first reads and automatic sync.
AI tool: database_sync_enable { databaseId: "..." }
See Realtime & Offline-First Apps for the full architecture.

Deleting a database

Ask the AI to delete a database. It soft-deletes with 7-day retention — destroys the PowerSync instance, deletes the Neon project, and removes secrets. Blocked if apps are still connected.
AI tool: delete_database { databaseId: "..." }

Listing databases

Ask the AI to show your databases. It lists all active instances with connected apps and sync status.
AI tool: list_databases {}