Skip to main content

SqliteSessionStore

Struct SqliteSessionStore 

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

SQLite-backed SessionStore.

Implementations§

Source§

impl SqliteSessionStore

Source

pub fn open(path: impl AsRef<Path>) -> Result<Self>

Open (or create) the sessions database at path.

Source

pub fn open_in_memory() -> Result<Self>

Open an in-memory database — convenient for tests.

Trait Implementations§

Source§

impl Clone for SqliteSessionStore

Source§

fn clone(&self) -> SqliteSessionStore

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 SessionStore for SqliteSessionStore

Source§

fn create<'life0, 'life1, 'async_trait>( &'life0 self, project: &'life1 str, messages: Vec<Message>, ) -> Pin<Box<dyn Future<Output = Result<SessionRecord>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Create a new session row and return the hydrated record.
Source§

fn fork<'life0, 'life1, 'async_trait>( &'life0 self, project: &'life1 str, parent: SessionId, messages: Vec<Message>, turns: u32, ) -> Pin<Box<dyn Future<Output = Result<SessionRecord>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Fork an existing session: create a child row carrying a copy of messages with parent_id set to parent and a turns carried over from the parent (Phase Z).
Source§

fn update<'life0, 'async_trait>( &'life0 self, id: SessionId, messages: Vec<Message>, turns: u32, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Replace the messages of an existing session and bump turns + updated_at.
Source§

fn rename<'life0, 'life1, 'async_trait>( &'life0 self, id: SessionId, title: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Set an explicit, user-chosen title for a session, overriding the auto-derived one (Phase RR — /rename). Leaves messages/turns untouched.
Source§

fn list_by_project<'life0, 'life1, 'async_trait>( &'life0 self, project: &'life1 str, limit: usize, ) -> Pin<Box<dyn Future<Output = Result<Vec<SessionRecord>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Most recent sessions for project first.
Source§

fn get<'life0, 'async_trait>( &'life0 self, id: SessionId, ) -> Pin<Box<dyn Future<Output = Result<Option<SessionRecord>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Fetch by id.
Source§

fn delete<'life0, 'async_trait>( &'life0 self, id: SessionId, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Remove a session.
Source§

fn latest<'life0, 'life1, 'async_trait>( &'life0 self, project: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Option<SessionRecord>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Most recent session for project, if any.
Source§

fn search<'life0, 'life1, 'async_trait>( &'life0 self, query: &'life1 str, limit: usize, ) -> Pin<Box<dyn Future<Output = Result<Vec<SearchHit>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Substring search across every session’s message bodies and titles. Case-insensitive. Most recently updated hits first (Phase L).
Source§

fn find_by_id_prefix<'life0, 'life1, 'async_trait>( &'life0 self, prefix: &'life1 str, limit: usize, ) -> Pin<Box<dyn Future<Output = Result<Vec<SessionRecord>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Resolve a UUID prefix to the matching SessionRecord(s). Empty vec when no match, multi-element when the prefix is ambiguous. Used by /load (Phase L).

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