Skip to main content

SqliteCheckpoint

Struct SqliteCheckpoint 

Source
pub struct SqliteCheckpoint { /* private fields */ }
Expand description

Stores latest checkpoints, transcripts, and middleware state in SQLite.

Implementations§

Source§

impl SqliteCheckpoint

Source

pub fn new(path: impl Into<PathBuf>) -> Result<Self>

Opens or creates a durable checkpoint database.

§Errors

Returns an error if configuration is invalid or a required resource cannot be initialized.

Trait Implementations§

Source§

impl CheckpointStore for SqliteCheckpoint

Source§

fn load<'a>( &'a self, session_id: &'a str, ) -> BoxFuture<'a, Result<Option<Checkpoint>>>

Loads the latest checkpoint for a session.
Source§

fn delete_sessions<'a>( &'a self, session_ids: &'a [String], ) -> BoxFuture<'a, Result<bool>>

Atomically deletes the selected sessions, their descendants, and session-scoped state. Read more
Source§

fn save<'a>( &'a self, checkpoint: &'a Checkpoint, transcript_delta: &'a [Value], execution: Option<&'a ExecutionRecord>, ) -> BoxFuture<'a, Result<()>>

Atomically replaces the checkpoint, appends transcript items, and records a finished turn.
Source§

fn save_with_events<'a>( &'a self, checkpoint: Checkpoint, transcript_delta: Vec<Value>, execution: Option<ExecutionRecord>, events: Vec<TimestampedEvent>, ) -> BoxFuture<'a, Result<Vec<JournalEvent>>>

Atomically saves one owned checkpoint and appends its normalized event batch. Read more
Source§

fn append_event<'a>( &'a self, session_id: &'a str, recorded_at_ms: i64, event: &'a Event, ) -> BoxFuture<'a, Result<JournalEvent>>

Assigns a session-local sequence and appends one normalized event atomically.
Source§

fn event_page<'a>( &'a self, session_id: &'a str, request: EventPageRequest, ) -> BoxFuture<'a, Result<EventPage>>

Loads one newest-first page of normalized session events.
Source§

fn session_summary<'a>( &'a self, session_id: &'a str, ) -> BoxFuture<'a, Result<Option<SessionSummary>>>

Loads catalog metadata for one session without reading its checkpoint context.
Source§

fn list_sessions_page( &self, request: SessionPageRequest, ) -> BoxFuture<'_, Result<SessionPage>>

Lists one page of the most recently updated sessions, newest first.
Source§

fn transcript_page<'a>( &'a self, session_id: &'a str, request: TranscriptPageRequest, ) -> BoxFuture<'a, Result<TranscriptPage>>

Loads one newest-first page of append-only transcript deltas.
Source§

fn execution_page<'a>( &'a self, session_id: &'a str, request: ExecutionPageRequest, ) -> BoxFuture<'a, Result<ExecutionPage>>

Loads one newest-first page of terminal user-turn records.
Source§

fn recent_executions( &self, limit: usize, ) -> BoxFuture<'_, Result<Vec<ExecutionRecord>>>

Loads the most recently started terminal user turns across all sessions.
Source§

fn fork<'a>( &'a self, parent_session_id: &'a str, parent_sequence: u64, checkpoint: &'a Checkpoint, ) -> BoxFuture<'a, Result<SessionSummary>>

Creates a child session at an exact durable parent sequence.
Source§

fn load_state<'a>( &'a self, scope: &'a str, key: &'a str, ) -> BoxFuture<'a, Result<Option<Value>>>

Loads the latest opaque state owned by one middleware namespace.
Source§

fn save_state<'a>( &'a self, scope: &'a str, key: &'a str, value: &'a Value, ) -> BoxFuture<'a, Result<()>>

Durably replaces opaque middleware state.

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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more