1. Documentation
  2. Databases
  3. SQLite
ReadmeGitHub
  • Introduction
  • Quickstart
  • CLI
  • Configuration
  • Identity
  • Branding
  • Themes
  • Monitors
  • Checks and scheduling
  • Metrics and badges
  • Incidents
  • Maintenance
  • Notifications
  • Subscribers
  • React Router
  • Next.js
  • Astro
  • SQLite
  • Cloudflare D1
  • PostgreSQL
  • Schema and migrations
  • Cloudflare
  • Vercel
  • Self-hosting
  • API overview
  • Status endpoints
  • Incident endpoints
  • Maintenance endpoints
  • Subscriber endpoints
  • Badges, feeds and metrics
  • Admin endpoints
  • The check run
  • Uptime and history
  • Automatic incidents
  • Notification delivery
  • Public subscriptions

SQLite

Configure a SQLite file, run automatic migrations and check what was applied.

Use SQLite for local development or a self-hosted server with a persistent disk. Create a project with --deployment later --database sqlite; the generator configures SQLite in heyo-status.config.ts along with the page and API. To change the database path, edit its database: sqlite("status.sqlite") setting. The relative filename uses the process's working directory.

For a deployed container or VM, use a writable, persistent path such as sqlite("/data/status.sqlite") and mount /data as a volume. A database in an ephemeral container filesystem disappears on redeploy.

When do migrations run?

You don't need to run SQL by hand. sqlite() enables migrations by default. Bun applies the bundled migrations when it creates the adapter; Node applies them before the first database operation. This happens when the app loads its config, including when you run the generated app for the first time. Starting it again after a package upgrade applies any new migrations. Already applied migrations are skipped.

The generated project also has a command you can run explicitly:

bash
bun run db:migrate

For SQLite, that command loads the config and reports that embedded migrations were applied. It isn't an extra prerequisite before bun dev. You can also run the CLI directly from the project root after a global install.

To check the file after startup, use the SQLite CLI if you have it installed:

bash
sqlite3 status.sqlite 'SELECT id FROM __heyo_status_migrations ORDER BY id;'

Use the same path as in sqlite(...). The table lists applied migration IDs, not your check results; status_results holds those. Before upgrading a production database, back up the file using SQLite's online backup command:

bash
sqlite3 /data/status.sqlite ".backup '/data/status.backup.sqlite'"

migrate: false turns automatic migrations off. Only use it if you apply the full schema before any status-page request; otherwise reads and check runs will fail on missing tables.

Runtime and options

sqlite() uses bun:sqlite on Bun and node:sqlite on Node. Use Node 22.13+ for node:sqlite without a flag; Node 22.5–22.12 requires --experimental-sqlite. On older Node versions, use Bun or another adapter. The driver is chosen at runtime, so the config doesn't import either one statically.

ts
sqlite("status.sqlite");
sqlite({ file: "/data/status.sqlite" });
sqlite({ file: ":memory:" }); // fresh, migrated database for a test
sqlite({ client: existingBunDatabase, migrate: false });

file defaults to "status.sqlite". Pass an existing bun:sqlite client if you manage its lifecycle yourself; client and file cannot be combined. :memory: is lost when the process ends. Neither Vercel nor Cloudflare Workers provides the persistent local disk this adapter needs: use PostgreSQL or D1 instead.

For the complete migration list and the other adapters, see Schema and migrations.

Astro< PreviousCloudflare D1Next >

Powered by heyo

On this page

When do migrations run?Runtime and options