Skip to main content

Module sqlite

Module sqlite 

Source
Expand description

SqliteRunStore — SQLite-backed RunStore using [rusqlite-isle].

The Connection is confined to a dedicated OS thread by AsyncIsle; every call is a typed closure dispatched over a bounded channel. step_entries and result_ref are stored as JSON blobs — the former is a pure trace/observability artifact (not queried relationally), the latter is caller-defined payload shape. append_step_entry runs as a read-modify-write inside a single transaction so concurrent appenders don’t clobber each other’s entries.

§Schema

CREATE TABLE IF NOT EXISTS runs (
  id                 TEXT PRIMARY KEY,
  task_id            TEXT NOT NULL,
  status             TEXT NOT NULL,      -- JSON-encoded `RunStatus`
  step_entries_json  TEXT NOT NULL,      -- JSON-encoded `Vec<StepEntry>`
  operator_sid       TEXT,
  result_ref_json    TEXT,               -- JSON-encoded `serde_json::Value`, NULL when unset
  created_at         INTEGER NOT NULL,
  updated_at         INTEGER NOT NULL
);
CREATE INDEX IF NOT EXISTS ix_runs_task_id ON runs(task_id, created_at);

Structs§

SqliteRunStore
SQLite-backed persistent RunStore.