Dispatch

SQLite Store

Lightweight SQLite store for embedded and single-node Dispatch deployments.

The store/sqlite package implements Dispatch's store interfaces using the grove ORM with the SQLite driver. It requires no external database process, making it suitable for embedded deployments, CLI tools, and standalone applications.

Usage

import (
    "github.com/xraph/grove"
    "github.com/xraph/grove/drivers/sqlitedriver"
    "github.com/xraph/dispatch/store/sqlite"
)

db, err := grove.Open(sqlitedriver.Open("dispatch.db"))
if err != nil {
    log.Fatal(err)
}

s := sqlite.New(db)
if err := s.Migrate(ctx); err != nil {
    log.Fatal(err)
}

d, err := dispatch.New(dispatch.WithStore(s))

Internals

AspectDetail
Drivergrove ORM + sqlitedriver
Migrationsgrove orchestrator with programmatic migrations
TransactionsSQLite-level transactions
ConcurrencyMultiple readers, single writer (WAL mode)
Pingdb.Ping(ctx)
CloseNo-op -- caller owns the *grove.DB lifecycle

When to use

  • Embedded or edge deployments where running PostgreSQL is impractical.
  • Local development and integration tests.
  • Single-process applications with moderate throughput.

On this page