pub struct SqliteContextStore { /* private fields */ }Expand description
SQLite-backed ContextStore implementation.
Uses WAL mode for concurrent read access and a single Mutex<Connection>
for thread-safe write access. All data is stored in two STRICT tables:
outputs for node outputs and globals for global key-value pairs.
Implementations§
Source§impl SqliteContextStore
impl SqliteContextStore
Sourcepub fn open(path: impl AsRef<Path>) -> Result<Self, ContextStoreError>
pub fn open(path: impl AsRef<Path>) -> Result<Self, ContextStoreError>
Open or create a ContextStore at the given path.
Creates the database file and tables if they don’t exist. Enables WAL mode and sets a busy timeout for concurrent access.
Sourcepub fn in_memory() -> Result<Self, ContextStoreError>
pub fn in_memory() -> Result<Self, ContextStoreError>
Create an in-memory ContextStore (for testing).
Trait Implementations§
Source§impl ContextStore for SqliteContextStore
impl ContextStore for SqliteContextStore
Source§fn put(
&self,
flow_run_id: FlowRunId,
node_id: NodeId,
value: &Value,
) -> Result<(), ContextStoreError>
fn put( &self, flow_run_id: FlowRunId, node_id: NodeId, value: &Value, ) -> Result<(), ContextStoreError>
Write a node’s output. Enforces write-once semantics: Read more
Source§fn get(
&self,
flow_run_id: FlowRunId,
node_id: NodeId,
) -> Result<Option<Value>, ContextStoreError>
fn get( &self, flow_run_id: FlowRunId, node_id: NodeId, ) -> Result<Option<Value>, ContextStoreError>
Read a node’s output. Returns None if not yet written.
Source§fn list_keys(
&self,
flow_run_id: FlowRunId,
) -> Result<Vec<NodeId>, ContextStoreError>
fn list_keys( &self, flow_run_id: FlowRunId, ) -> Result<Vec<NodeId>, ContextStoreError>
List all node IDs that have outputs for a given flow run.
Source§fn put_global(&self, key: &str, value: &Value) -> Result<(), ContextStoreError>
fn put_global(&self, key: &str, value: &Value) -> Result<(), ContextStoreError>
Write a global key-value pair. Globals are not scoped to a flow run.
Write-once semantics: second put for the same key returns GlobalAlreadyExists.
Source§fn upsert_global(
&self,
key: &str,
value: &Value,
) -> Result<(), ContextStoreError>
fn upsert_global( &self, key: &str, value: &Value, ) -> Result<(), ContextStoreError>
Write or update a global key-value pair.
Unlike
put_global, this allows overwriting an existing value.
Used for mutable global metadata (e.g., coordinator map).Source§fn get_global(&self, key: &str) -> Result<Option<Value>, ContextStoreError>
fn get_global(&self, key: &str) -> Result<Option<Value>, ContextStoreError>
Read a global value. Returns None if not yet written.
Auto Trait Implementations§
impl !Freeze for SqliteContextStore
impl RefUnwindSafe for SqliteContextStore
impl Send for SqliteContextStore
impl Sync for SqliteContextStore
impl Unpin for SqliteContextStore
impl UnsafeUnpin for SqliteContextStore
impl UnwindSafe for SqliteContextStore
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more