Skip to main content
The SQLite backend is the easiest way to get started without running an external database. It’s ideal for local development, testing, and single-server deployments. When you’re ready for production with multiple workers, switch to PostgreSQL. Uses bun:sqlite for Bun and node:sqlite for Node.js (requires Node.js 22.5+).

Setup

Note: BackendSqlite.connect() is synchronous (no await needed).

File Path

The database file is created if it doesn’t exist:

Configuration Options

Git Ignore

Add the database file and SQLite sidecar files to .gitignore:
The CLI’s init command does this automatically when you choose SQLite.

When to Use SQLite

Good for:
  • Local development
  • Testing and CI
  • Single-server deployments
  • Prototyping
  • Small-scale production with low throughput
Consider PostgreSQL for:
  • Multi-server deployments
  • High concurrency requirements
  • Production workloads with many workers
  • Environments requiring database-level backups

Concurrency

SQLite supports concurrent reads but uses locking for writes. The backend handles this with BEGIN IMMEDIATE transactions. For single-worker setups, this works well. For multiple workers, PostgreSQL is recommended.

Namespaces

Use namespaceId to isolate environments:
See Namespaces for more details.

Config File Example

For use with the CLI, create openworkflow.config.ts:

Development + Production Setup

A common pattern uses SQLite for development and PostgreSQL for production: