/ Docs

SQLite Adapter

Overview

The SQLite adapter persists data to local database files. It provides durability across process restarts without requiring a running database server, making it a practical choice for development and small production deployments.

Installation

The SQLite adapter lives in a separate package:

npm i @bounda-dev/adapter-sqlite

Supported Features

FeatureSupported
Event StoreYes
Read ModelYes
Policy DLQYes
Process Manager DLQYes
SchedulingYes

When to Use

  • Development — Persistent storage without infrastructure overhead.
  • Small production deployments — Single-process applications where a full database server is unnecessary.
  • CI environments — Self-contained tests that need persistence.

Configuration

Every SQLite configuration requires a path property pointing to the database file. Bounda creates the file automatically if it does not exist.

Event Store

domain: {
  order: {
    eventStore: { type: "sqlite", path: "./db/order-events.db" },
  },
}

Read Model

read: {
  "order-summary": { type: "sqlite", path: "./db/order-summary.db" },
}

Scheduling

domain: {
  order: {
    scheduling: {
      type: "sqlite",
      path: "./db/order-scheduler.db",
      pollingIntervalMs: 100,
    },
  },
}
OptionTypeDescription
type"sqlite"Adapter type
pathstringFile path for the SQLite database
pollingIntervalMsnumberHow often the scheduler polls for due commands, in milliseconds

Policy DLQ

domain: {
  order: {
    policies: {
      dlq: { type: "sqlite", path: "./db/order-policy-dlq.db" },
    },
  },
}

Process Manager DLQ

domain: {
  order: {
    processManagers: {
      dlq: { type: "sqlite", path: "./db/order-pm-dlq.db" },
    },
  },
}

Complete Example

import type { Config } from "@bounda-dev/config";

export default {
  rootDir: "src",
  domain: {
    order: {
      eventStore: { type: "sqlite", path: "./db/order-events.db" },
      scheduling: {
        type: "sqlite",
        path: "./db/order-scheduler.db",
        pollingIntervalMs: 100,
      },
      policies: {
        dlq: { type: "sqlite", path: "./db/order-policy-dlq.db" },
      },
      processManagers: {
        dlq: { type: "sqlite", path: "./db/order-pm-dlq.db" },
      },
    },
  },
  read: {
    "order-summary": { type: "sqlite", path: "./db/order-summary.db" },
    "order-catalog": { type: "sqlite", path: "./db/order-catalog.db" },
  },
} satisfies Config;