Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.kazzle.com/llms.txt

Use this file to discover all available pages before exploring further.

Every database is a dedicated Postgres instance, isolated, scale-to-zero, with pooled and direct connections. Ask the AI to create one and it handles setup and credentials.

Creating a database

Tell the AI to create a database and give it a name. It sets up a Postgres instance and stores connection credentials as vault secrets.

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

Add the credential secret IDs to a secret collection, then reference them in your package.json scripts:
{
  "scripts": {
    "dev": "kazzle run --collection=my-saas --env=dev -- bun run server.ts"
  }
}
Your process reads DATABASE_URL and DIRECT_DATABASE_URL from process.env as normal.

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. Your app gets instant local reads and automatic background sync. 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

  1. “Create a database called my-app-db”
  2. The AI sets up Postgres and stores credentials in the vault
  3. “Create a todos table with id, text, done, and created_at”
  4. The AI runs the SQL
  5. “Wire it into my app” - the AI creates a secret collection, adds credentials, and configures kazzle run
For realtime apps with offline support, the AI also turns on sync and sets up the client-side schema. See building a realtime app for the full flow.