pub struct SqliteStore { /* private fields */ }Expand description
Cloneable SQLite-backed effect, checkpoint, and journal store.
Clones share one connection and serialize operations at the connection
boundary. SQLite transactions still provide persistence and CAS guarantees
across separately opened store instances and processes.
Implementations§
Source§impl SqliteStore
impl SqliteStore
Sourcepub fn open(path: impl AsRef<Path>) -> Result<Self, SqliteStoreError>
pub fn open(path: impl AsRef<Path>) -> Result<Self, SqliteStoreError>
Opens or creates a file-backed store and initializes its schema.
§Errors
Returns SqliteStoreError when the database cannot be opened or
initialized.
Sourcepub fn open_in_memory() -> Result<Self, SqliteStoreError>
pub fn open_in_memory() -> Result<Self, SqliteStoreError>
Creates a process-local SQLite database, primarily for tests.
§Errors
Returns SqliteStoreError when SQLite initialization fails.
Sourcepub fn events(&self, run_id: RunId) -> Result<Vec<RunEvent>, SqliteStoreError>
pub fn events(&self, run_id: RunId) -> Result<Vec<RunEvent>, SqliteStoreError>
Loads all journal events for one Run in sequence order.
§Errors
Returns SqliteStoreError when querying or decoding fails.
Trait Implementations§
Source§impl ArtifactStore for SqliteStore
impl ArtifactStore for SqliteStore
Source§fn put(
&self,
write: ArtifactWrite,
) -> ArtifactFuture<'_, Result<ArtifactRef, ArtifactError>>
fn put( &self, write: ArtifactWrite, ) -> ArtifactFuture<'_, Result<ArtifactRef, ArtifactError>>
Idempotently writes content and returns its integrity-bound reference.
Source§fn get(
&self,
reference: &ArtifactRef,
) -> ArtifactFuture<'_, Result<Artifact, ArtifactError>>
fn get( &self, reference: &ArtifactRef, ) -> ArtifactFuture<'_, Result<Artifact, ArtifactError>>
Loads and verifies one artifact.
Source§fn list(
&self,
scope: &ArtifactScope,
after: Option<&str>,
limit: u32,
) -> ArtifactFuture<'_, Result<ArtifactPage, ArtifactError>>
fn list( &self, scope: &ArtifactScope, after: Option<&str>, limit: u32, ) -> ArtifactFuture<'_, Result<ArtifactPage, ArtifactError>>
Lists one stable, bounded page inside one scope.
Source§fn delete(
&self,
scope: &ArtifactScope,
artifact_id: &str,
) -> ArtifactFuture<'_, Result<bool, ArtifactError>>
fn delete( &self, scope: &ArtifactScope, artifact_id: &str, ) -> ArtifactFuture<'_, Result<bool, ArtifactError>>
Idempotently deletes one artifact and its idempotency records.
Source§fn purge_expired(
&self,
scope: &ArtifactScope,
now_unix_ms: u64,
limit: u32,
) -> ArtifactFuture<'_, Result<u32, ArtifactError>>
fn purge_expired( &self, scope: &ArtifactScope, now_unix_ms: u64, limit: u32, ) -> ArtifactFuture<'_, Result<u32, ArtifactError>>
Deletes at most
limit expired artifacts in one scope.Source§impl CheckpointStore for SqliteStore
impl CheckpointStore for SqliteStore
Source§fn load(&self, id: CheckpointId) -> Result<Checkpoint, CheckpointError>
fn load(&self, id: CheckpointId) -> Result<Checkpoint, CheckpointError>
Loads the latest checkpoint revision. Read more
Source§fn compare_and_swap(
&self,
checkpoint: &Checkpoint,
expected_revision: Option<u64>,
) -> Result<(), CheckpointError>
fn compare_and_swap( &self, checkpoint: &Checkpoint, expected_revision: Option<u64>, ) -> Result<(), CheckpointError>
Creates or atomically replaces a checkpoint. Read more
Source§impl Clone for SqliteStore
impl Clone for SqliteStore
Source§fn clone(&self) -> SqliteStore
fn clone(&self) -> SqliteStore
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl ConversationStore for SqliteStore
impl ConversationStore for SqliteStore
Source§fn create(
&self,
conversation_id: ConversationId,
namespace: MemoryNamespace,
) -> ConversationStoreFuture<'_, Result<ConversationCreateOutcome, ConversationStoreError>>
fn create( &self, conversation_id: ConversationId, namespace: MemoryNamespace, ) -> ConversationStoreFuture<'_, Result<ConversationCreateOutcome, ConversationStoreError>>
Idempotently creates one empty conversation.
Source§fn load_view(
&self,
conversation_id: ConversationId,
namespace: MemoryNamespace,
window: ConversationWindow,
summary_batch: ConversationSummaryBatch,
) -> ConversationStoreFuture<'_, Result<ConversationView, ConversationStoreError>>
fn load_view( &self, conversation_id: ConversationId, namespace: MemoryNamespace, window: ConversationWindow, summary_batch: ConversationSummaryBatch, ) -> ConversationStoreFuture<'_, Result<ConversationView, ConversationStoreError>>
Loads a bounded view without deleting or rewriting transcript entries.
Source§fn list_transcript(
&self,
conversation_id: ConversationId,
namespace: MemoryNamespace,
after: Option<ConversationSequence>,
limit: ConversationWindow,
) -> ConversationStoreFuture<'_, Result<Vec<ConversationTranscriptEntry>, ConversationStoreError>>
fn list_transcript( &self, conversation_id: ConversationId, namespace: MemoryNamespace, after: Option<ConversationSequence>, limit: ConversationWindow, ) -> ConversationStoreFuture<'_, Result<Vec<ConversationTranscriptEntry>, ConversationStoreError>>
Lists immutable transcript entries strictly after an optional sequence.
Source§fn append(
&self,
namespace: MemoryNamespace,
command: ConversationAppend,
) -> ConversationStoreFuture<'_, Result<ConversationVersion, ConversationStoreError>>
fn append( &self, namespace: MemoryNamespace, command: ConversationAppend, ) -> ConversationStoreFuture<'_, Result<ConversationVersion, ConversationStoreError>>
Atomically appends canonical messages under the expected version.
Source§fn commit_summary(
&self,
namespace: MemoryNamespace,
command: ConversationSummaryCommit,
) -> ConversationStoreFuture<'_, Result<ConversationSummary, ConversationStoreError>>
fn commit_summary( &self, namespace: MemoryNamespace, command: ConversationSummaryCommit, ) -> ConversationStoreFuture<'_, Result<ConversationSummary, ConversationStoreError>>
Monotonically replaces the lossy summary under the expected transcript version.
Source§fn upsert_memory(
&self,
command: SemanticMemoryUpsert,
) -> ConversationStoreFuture<'_, Result<SemanticMemory, ConversationStoreError>>
fn upsert_memory( &self, command: SemanticMemoryUpsert, ) -> ConversationStoreFuture<'_, Result<SemanticMemory, ConversationStoreError>>
Creates or compare-and-swaps one explicitly curated semantic memory.
Source§fn search_memory(
&self,
query: SemanticMemoryQuery,
) -> ConversationStoreFuture<'_, Result<Vec<SemanticMemory>, ConversationStoreError>>
fn search_memory( &self, query: SemanticMemoryQuery, ) -> ConversationStoreFuture<'_, Result<Vec<SemanticMemory>, ConversationStoreError>>
Searches semantic memory without reading transcript or journal storage.
Source§fn upsert_memory_scoped(
&self,
command: SemanticMemoryUpsert,
context: RetrievalContext,
) -> Pin<Box<dyn Future<Output = Result<SemanticMemoryUpsertOutcome, ConversationStoreError>> + Send + '_>>
fn upsert_memory_scoped( &self, command: SemanticMemoryUpsert, context: RetrievalContext, ) -> Pin<Box<dyn Future<Output = Result<SemanticMemoryUpsertOutcome, ConversationStoreError>> + Send + '_>>
Writes memory under an explicit cancellation/deadline scope. Read more
Source§fn search_memory_scoped(
&self,
query: SemanticMemoryQuery,
context: RetrievalContext,
) -> Pin<Box<dyn Future<Output = Result<SemanticMemorySearchOutcome, ConversationStoreError>> + Send + '_>>
fn search_memory_scoped( &self, query: SemanticMemoryQuery, context: RetrievalContext, ) -> Pin<Box<dyn Future<Output = Result<SemanticMemorySearchOutcome, ConversationStoreError>> + Send + '_>>
Searches memory under an explicit cancellation/deadline scope. Read more
Source§impl Debug for SqliteStore
impl Debug for SqliteStore
Source§impl DurableConversationStore for SqliteStore
impl DurableConversationStore for SqliteStore
Source§fn commit_durable_turn(
&self,
command: DurableConversationCommit,
) -> ConversationStoreFuture<'_, Result<ConversationVersion, ConversationStoreError>>
fn commit_durable_turn( &self, command: DurableConversationCommit, ) -> ConversationStoreFuture<'_, Result<ConversationVersion, ConversationStoreError>>
Atomically appends a transcript turn and advances its checkpoint.
Source§impl EffectStore for SqliteStore
impl EffectStore for SqliteStore
Source§fn load(
&self,
id: EffectId,
) -> Result<Option<EffectRecord>, EffectExecutorError>
fn load( &self, id: EffectId, ) -> Result<Option<EffectRecord>, EffectExecutorError>
Loads a record by effect identity. Read more
Source§fn find_by_idempotency(
&self,
capability_id: CapabilityId,
key: &str,
) -> Result<Option<EffectRecord>, EffectExecutorError>
fn find_by_idempotency( &self, capability_id: CapabilityId, key: &str, ) -> Result<Option<EffectRecord>, EffectExecutorError>
Resolves a logical effect by capability-scoped idempotency key. Read more
Source§fn compare_and_swap(
&self,
record: &EffectRecord,
expected_revision: Option<u64>,
) -> Result<(), EffectExecutorError>
fn compare_and_swap( &self, record: &EffectRecord, expected_revision: Option<u64>, ) -> Result<(), EffectExecutorError>
Creates or atomically replaces a record. Read more
Auto Trait Implementations§
impl Freeze for SqliteStore
impl RefUnwindSafe for SqliteStore
impl Send for SqliteStore
impl Sync for SqliteStore
impl Unpin for SqliteStore
impl UnsafeUnpin for SqliteStore
impl UnwindSafe for SqliteStore
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