Sentinel

SQLite Store

Lightweight SQLite store for development, testing, and single-node deployments.

The store/sqlite package implements Sentinel's store.Store interface using the grove ORM with the SQLite driver. It requires no external database process, making it ideal for development, integration tests, and single-node deployments.

Usage

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

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

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

eng, err := engine.New(
    engine.WithStore(s),
)

Pass ":memory:" for a fully in-process, zero-persistence store useful in tests:

db, err := grove.Open(sqlitedriver.Open(":memory:"))

Tables

The SQLite store creates the same tables as the PostgreSQL store, with SQLite-appropriate types:

TableEntityKey columns
sentinel_suitesSuitesid, app_id, name, system_prompt, model, persona_ref, metadata (TEXT/JSON)
sentinel_casesCasesid, suite_id, name, input, expected, scenario_type, scorers (TEXT/JSON), tags (TEXT/JSON)
sentinel_runsRunsid, suite_id, app_id, model, state, pass_rate, avg_score, dimension_scores (TEXT/JSON)
sentinel_resultsResultsid, run_id, case_id, status, score, output, scorer_results (TEXT/JSON), run_trace (TEXT/JSON)
sentinel_baselinesBaselinesid, suite_id, run_id, name, results (TEXT/JSON), dimension_scores (TEXT/JSON), is_current
sentinel_prompt_versionsPrompt versionsid, suite_id, version, system_prompt, changelog, is_current

Internals

AspectDetail
Drivergrove ORM + sqlitedriver
Migrationsgrove orchestrator with programmatic migrations
TransactionsSQLite-level transactions
ConcurrencyMultiple readers, single writer (WAL mode)
JSON columnsStored as TEXT with JSON serialization/deserialization

When to use

  • Development and local testing without external dependencies.
  • Single-process or embedded deployments.
  • CI pipelines where spinning up PostgreSQL is impractical.
  • Quick prototyping and evaluation experiments on a single machine.

On this page