Controlplane
Preview (test fixture)
Older
You are reading Preview (test fixture). The current release is documented here.
Docs/Controlplane/SQLite Store
Open

Reading1 min
Updated31 Jul 2026
Sourcev1/stores/sqlite.mdx
Inherited from v1

The SQLite store (store/sqlite) provides a lightweight, embedded backend using the Grove ORM with sqlitedriver. It implements the full store.Store interface and is well-suited for single-node deployments, local development, and testing.

When to use01

  • Local development -- single-file database, no server process required.

  • Testing -- fast, isolated store with no external dependencies.

  • Edge / embedded -- CLI tools, desktop apps, or single-process services.

  • CI pipelines -- deterministic tests without a database container.

Configuration02

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

// Open a SQLite connection via Grove's sqlitedriver.
db := grove.Open(sqlitedriver.New("ctrlplane.db"))

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

With the app

cp, err := app.New(
    app.WithStore(s),
)

Internals03

AspectDetail
DriverGrove ORM with sqlitedriver (SQLite)
MigrationsGrove migration orchestrator with programmatic migrations
TransactionsDatabase-level transactions via SQLite
MigrateCreates tables and indexes
Pingdb.Ping(ctx)
CloseCloses the database connection

Limitations04

  • Single-writer -- SQLite uses database-level write locks. High write concurrency will serialize.

  • Single process -- cannot be shared across multiple instances.

  • Not horizontally scalable -- suited for single-process or embedded use.

Comparison05

FeatureMemoryBadgerPostgreSQLSQLiteMongoDB
SetupNonePath onlyDSNFile pathURI
PersistenceNoYesYesYesYes
Multi-processNoNoYesNoYes
Query flexibilityLowLowHighMediumHigh
Best forTestsEmbedded KVProduction SQLEmbedded SQLProduction NoSQL