Documentation
¶
Overview ¶
Package sqlite is the default on-disk agent.Durable: a single-file, zero-cgo SQLite journal (via modernc.org/sqlite). It implements named-step memoization — the same primitive as DBOS RunAsStep / ADK RunNode — so an agent run survives a process crash and resumes without re-running completed steps. No cluster, no daemon: one binary + one file. The side-effect-safety layer (agent.Safety / ResumeHalt) sits above this.
Store implements agent.Lister, so single-node crash recovery (agent.Recover) works on the default on-disk store: after a restart it enumerates the journal's runs and re-drives the in-flight ones. It does NOT implement agent.Leaser: cross-process HA lease coordination (one driver per run across nodes) remains Postgres-only, since SQLite is a single-writer, single-node journal. Under a single recoverer this is safe regardless, because memoization makes re-driving at-most-once.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store is a SQLite-backed agent.Durable.
func Open ¶
Open opens (creating if needed) a SQLite journal at path. Use ":memory:" for an ephemeral store in tests. WAL mode is enabled for concurrent readers alongside the single writer.
func (*Store) Do ¶
func (s *Store) Do(ctx context.Context, runID, name string, fn func(context.Context) (agent.Record, error)) (agent.Record, error)
Do implements agent.Durable: memoized, named-step execution.
func (*Store) Runs ¶
Runs implements agent.Lister: the distinct run IDs the store holds, so agent.Recover can enumerate in-flight runs to re-drive after a restart. This makes single-node crash recovery work on the default on-disk store; cross-process HA leasing (agent.Leaser) remains Postgres-only, since SQLite is a single-writer, single-node journal.