|
NeoGraph 0.16.0
A C++20 Graph Agent Engine Library — LangGraph for C++
|
Persistent CheckpointStore backed by a SQLite database file. More...
#include <sqlite_checkpoint.h>
Public Member Functions | |
| size_t | blob_count () |
| Number of distinct channel-value blobs currently held. | |
| void | clear_writes (const std::string &thread_id, const std::string &parent_checkpoint_id) override |
| Discard pending writes for a parent checkpoint once its successor super-step has been fully committed. | |
| void | delete_thread (const std::string &thread_id) override |
| Delete all checkpoints for a thread. | |
| void | drop_schema () |
| Drop and recreate checkpoint payload tables. | |
| std::vector< PendingWrite > | get_writes (const std::string &thread_id, const std::string &parent_checkpoint_id) override |
| Load all pending writes attached to a parent checkpoint. | |
| std::vector< Checkpoint > | list (const std::string &thread_id, int limit=100) override |
| List checkpoints for a thread, most recently saved first, one entry per ID; the first entry is load_latest(). | |
| std::optional< Checkpoint > | load_by_id (const std::string &id) override |
| Load a checkpoint by its unique ID. | |
| std::optional< Checkpoint > | load_latest (const std::string &thread_id) override |
| Load the most recently saved checkpoint for a thread. | |
| void | put_writes (const std::string &thread_id, const std::string &parent_checkpoint_id, const PendingWrite &write) override |
| Record a successful node execution within an in-progress super-step. | |
| bool | requires_managed_budget (const std::string &thread_id) override |
| Monotonic denial evidence, independent of retained checkpoint JSON. | |
| void | save (const Checkpoint &cp) override |
| Save a checkpoint. | |
| SqliteCheckpointStore (const std::string &db_path) | |
| SqliteCheckpointStore (const std::string &db_path, std::chrono::milliseconds busy_timeout) | |
| Configure how long writes wait for a competing SQLite writer, and how long opening waits for another store or process opening or migrating the same database at the same moment. | |
Public Member Functions inherited from neograph::graph::CheckpointStore | |
| virtual bool | retains_native_checkpoint () const noexcept |
| Describes real local C++ custody, not a financial admission/grant. | |
Persistent CheckpointStore backed by a SQLite database file.
Construct with a filesystem path. ":memory:" works too for tests. The DB file is created if missing; the schema is materialised on first connect via CREATE TABLE IF NOT EXISTS. A thread's checkpoints are ordered by save (save_seq), as in the PostgreSQL store.
Definition at line 69 of file sqlite_checkpoint.h.
|
explicit |
| db_path | Filesystem path or ":memory:". Anything sqlite3_open accepts. |
| std::runtime_error | on open or DDL failure. |
| size_t neograph::graph::SqliteCheckpointStore::blob_count | ( | ) |
Number of distinct channel-value blobs currently held.
Mirrors InMemoryCheckpointStore::blob_count() and PostgresCheckpointStore::blob_count() so dedup tests can be written against the abstract interface uniformly.
|
overridevirtual |
Discard pending writes for a parent checkpoint once its successor super-step has been fully committed.
Called by the engine after the new super-step checkpoint has been durably saved, so pending writes are never cleared while still being the only record of a node's output.
| thread_id | Thread identifier. |
| parent_checkpoint_id | Checkpoint whose pending writes to clear. |
Reimplemented from neograph::graph::CheckpointStore.
|
overridevirtual |
Delete all checkpoints for a thread.
| thread_id | Thread identifier to delete. |
Reimplemented from neograph::graph::CheckpointStore.
| void neograph::graph::SqliteCheckpointStore::drop_schema | ( | ) |
Drop and recreate checkpoint payload tables.
Test-only utility. Managed-budget obligations, heads, effects and migration markers remain intact.
|
overridevirtual |
Load all pending writes attached to a parent checkpoint.
Called by the engine on resume to skip already-completed tasks. Default implementation returns an empty vector.
| thread_id | Thread identifier. |
| parent_checkpoint_id | Checkpoint whose pending writes to load. |
Reimplemented from neograph::graph::CheckpointStore.
|
overridevirtual |
List checkpoints for a thread, most recently saved first, one entry per ID; the first entry is load_latest().
| thread_id | Thread identifier. |
| limit | Maximum number of checkpoints to return (default: 100). |
Reimplemented from neograph::graph::CheckpointStore.
|
overridevirtual |
Load a checkpoint by its unique ID.
| id | Checkpoint UUID. |
Reimplemented from neograph::graph::CheckpointStore.
|
overridevirtual |
Load the most recently saved checkpoint for a thread.
"Latest" is save order, not timestamp or step: a later run on a thread restarts at step 0, and saves can share a millisecond.
| thread_id | Thread identifier. |
Reimplemented from neograph::graph::CheckpointStore.
|
overridevirtual |
Record a successful node execution within an in-progress super-step.
Called by the engine immediately after a node returns successfully and before its writes are applied to the shared GraphState. The parent_checkpoint_id anchors the pending write to the super-step boundary it was produced under.
Default implementation is a no-op so custom stores keep working; such stores fall back to "full super-step replay" on resume.
| thread_id | Thread identifier. |
| parent_checkpoint_id | Checkpoint marking the start of the in-progress super-step. |
| write | The pending write record to persist. |
Reimplemented from neograph::graph::CheckpointStore.
|
overridevirtual |
Save a checkpoint.
Saving an ID the thread already holds replaces that checkpoint and makes it the thread's latest, as if it were saved for the first time.
| cp | The checkpoint to persist. |
Reimplemented from neograph::graph::CheckpointStore.