Skip to main content

SqliteStore

Struct SqliteStore 

Source
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

Source

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.

Source

pub fn open_in_memory() -> Result<Self, SqliteStoreError>

Creates a process-local SQLite database, primarily for tests.

§Errors

Returns SqliteStoreError when SQLite initialization fails.

Source

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

Source§

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>>

Loads and verifies one artifact.
Source§

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>>

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>>

Deletes at most limit expired artifacts in one scope.
Source§

impl CheckpointStore for SqliteStore

Source§

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>

Creates or atomically replaces a checkpoint. Read more
Source§

impl Clone for SqliteStore

Source§

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)

Performs copy-assignment from source. Read more
Source§

impl ConversationStore for SqliteStore

Source§

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>>

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>>

Lists immutable transcript entries strictly after an optional sequence.
Source§

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>>

Monotonically replaces the lossy summary under the expected transcript version.
Source§

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>>

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 + '_>>

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 + '_>>

Searches memory under an explicit cancellation/deadline scope. Read more
Source§

impl Debug for SqliteStore

Source§

fn fmt(&self, formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl DurableConversationStore for SqliteStore

Source§

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

Source§

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>

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>

Creates or atomically replaces a record. Read more
Source§

impl Journal for SqliteStore

Source§

fn record(&self, event: &RunEvent) -> Result<(), JournalError>

Records one event. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.