Creating a database
Tell the AI what the app needs. It should list existing databases first and reuse a suitable active database when one exists. It creates a new Postgres instance only when you ask for isolation or no existing database fits.Credentials
Database credentials are managed through the vault.- View credentials - returns the current connection URIs for the database.
- Regenerate credentials - resets the database password and creates new vault secrets. Use when credentials are missing, compromised, or need rotation. Old credentials stop working immediately.
Using credentials in an app
For generated apps, the AI wires database credentials into the process component with thedb tool. App code reads normal env vars such as DATABASE_URL and DIRECT_DATABASE_URL.
For manual local commands, run through the Kazzle CLI with the right collection and environment:
VITE_* variables.
Migrations
Schema changes go in SQL files in the app repo (e.g.migrations/001_create_todos.sql). Kazzle can run those migrations as part of your app’s deploy flow. If realtime sync is enabled, the AI also updates the related sync setup.
Enabling realtime sync
Ask the AI to enable sync on a database. It should wait until the database showssync: ready before wiring a realtime app. See Realtime sync for how it works.
Deleting a database
Ask the AI to delete a database. Kazzle marks it as deleted first, and the database can be restored before permanent cleanup runs.Example: setting up a database from scratch
- “Create a database called my-app-db”
- The AI reuses a suitable database or sets up Postgres and stores credentials in the vault
- “Create a todos table with id, text, done, and created_at”
- The AI runs the SQL
- “Wire it into my app” - the AI connects the database to the app’s process component