|
NeoGraph 0.10.0
A C++17 Graph Agent Engine Library — LangGraph for C++
|
SQLite-backed CheckpointStore — single-file persistence for embedded and single-process deployments. More...
#include <neograph/api.h>#include <neograph/graph/checkpoint.h>#include <memory>#include <mutex>#include <string>Go to the source code of this file.
Classes | |
| class | neograph::graph::SqliteCheckpointStore |
| Persistent CheckpointStore backed by a SQLite database file. More... | |
SQLite-backed CheckpointStore — single-file persistence for embedded and single-process deployments.
Mirrors PostgresCheckpointStore's schema and semantics so swapping the backend is a one-line change at the call site:
auto store = std::make_shared<SqliteCheckpointStore>("/var/lib/neograph.db");
vs. the Postgres variant:
auto store = std::make_shared<PostgresCheckpointStore>( "postgresql://user:pass@host/db");
Both implement the same CheckpointStore interface with identical dedup behaviour: channel values are stored once per (thread, channel, version) triple via INSERT ... ON CONFLICT DO NOTHING. The schema uses the same neograph_* table prefix so a sqlite_dump → psql import migration path is conceivable (though not implemented).
SQLite wins when:
Postgres wins when multiple agent processes share state, when checkpoint volume is high enough that WAL + fsync cost matters, or when an external operator wants to inspect/manage state with their existing PG tooling.
The connection is wrapped in a mutex; every public method holds it for the duration of its work. SQLite's own thread-safety mode is set to "serialized" by default in libsqlite3, so this mutex is belt-and- suspenders against concurrent statement preparation. WAL journal mode is enabled at construction so reads don't block other reads.
Definition in file sqlite_checkpoint.h.