pub struct SqliteBackend { /* private fields */ }Expand description
SQLite storage backend
Wraps the existing Database implementation with async interface.
Uses tokio::task::spawn_blocking for rusqlite operations.
Implementations§
Trait Implementations§
Source§impl StorageBackend for SqliteBackend
impl StorageBackend for SqliteBackend
Source§fn get_stats<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(usize, usize, usize)>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_stats<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(usize, usize, usize)>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get database statistics Read more
Source§fn clear<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn clear<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Clear all data from the database
Source§fn insert_artifact<'life0, 'life1, 'async_trait>(
&'life0 self,
artifact: &'life1 Artifact,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn insert_artifact<'life0, 'life1, 'async_trait>(
&'life0 self,
artifact: &'life1 Artifact,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Insert an artifact
Source§fn get_artifact<'life0, 'life1, 'async_trait>(
&'life0 self,
artifact_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<Artifact>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_artifact<'life0, 'life1, 'async_trait>(
&'life0 self,
artifact_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<Artifact>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Get artifact by ID
Source§fn get_artifact_by_path<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<Artifact>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_artifact_by_path<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<Artifact>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Get artifact by path
Source§fn delete_artifact<'life0, 'life1, 'async_trait>(
&'life0 self,
artifact_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn delete_artifact<'life0, 'life1, 'async_trait>(
&'life0 self,
artifact_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Delete artifact and associated spans Read more
Source§fn determine_ingest_action<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
path: &'life1 str,
content_hash: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<IngestAction>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn determine_ingest_action<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
path: &'life1 str,
content_hash: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<IngestAction>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Determine what action to take when ingesting a file
Source§fn insert_spans<'life0, 'life1, 'async_trait>(
&'life0 self,
spans: &'life1 [Span],
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn insert_spans<'life0, 'life1, 'async_trait>(
&'life0 self,
spans: &'life1 [Span],
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Insert multiple spans in a transaction
Source§fn get_all_spans<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<Span>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_all_spans<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<Span>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get all spans (for index building)
Source§fn search_spans<'life0, 'life1, 'async_trait>(
&'life0 self,
query: &'life1 str,
limit: usize,
) -> Pin<Box<dyn Future<Output = Result<Vec<Span>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn search_spans<'life0, 'life1, 'async_trait>(
&'life0 self,
query: &'life1 str,
limit: usize,
) -> Pin<Box<dyn Future<Output = Result<Vec<Span>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Search spans by text (lexical search)
Source§fn get_vector_search<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Arc<dyn VectorSearchProvider>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_vector_search<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Arc<dyn VectorSearchProvider>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get the vector search provider for this backend Read more
Source§fn invalidate_vector_index<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn invalidate_vector_index<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Invalidate cached vector index (called after data changes)
Source§fn create_session<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
user_id: Option<&'life1 str>,
title: Option<&'life2 str>,
) -> Pin<Box<dyn Future<Output = Result<Session>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn create_session<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
user_id: Option<&'life1 str>,
title: Option<&'life2 str>,
) -> Pin<Box<dyn Future<Output = Result<Session>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Create a new session
Source§fn get_session<'life0, 'life1, 'async_trait>(
&'life0 self,
session_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<Session>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_session<'life0, 'life1, 'async_trait>(
&'life0 self,
session_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<Session>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Get session by ID
Source§fn list_sessions<'life0, 'life1, 'async_trait>(
&'life0 self,
user_id: Option<&'life1 str>,
limit: Option<usize>,
) -> Pin<Box<dyn Future<Output = Result<Vec<Session>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn list_sessions<'life0, 'life1, 'async_trait>(
&'life0 self,
user_id: Option<&'life1 str>,
limit: Option<usize>,
) -> Pin<Box<dyn Future<Output = Result<Vec<Session>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
List sessions with optional filtering
Source§fn update_session<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
session_id: &'life1 str,
title: Option<&'life2 str>,
metadata: Option<&'life3 Value>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn update_session<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
session_id: &'life1 str,
title: Option<&'life2 str>,
metadata: Option<&'life3 Value>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Update session metadata
Source§fn delete_session<'life0, 'life1, 'async_trait>(
&'life0 self,
session_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn delete_session<'life0, 'life1, 'async_trait>(
&'life0 self,
session_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Delete session and all associated data
Source§fn add_message<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
session_id: &'life1 str,
role: MessageRole,
content: &'life2 str,
metadata: Option<&'life3 Value>,
) -> Pin<Box<dyn Future<Output = Result<Message>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn add_message<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
session_id: &'life1 str,
role: MessageRole,
content: &'life2 str,
metadata: Option<&'life3 Value>,
) -> Pin<Box<dyn Future<Output = Result<Message>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Add message to session
Source§fn get_messages<'life0, 'life1, 'async_trait>(
&'life0 self,
session_id: &'life1 str,
limit: Option<usize>,
) -> Pin<Box<dyn Future<Output = Result<Vec<Message>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_messages<'life0, 'life1, 'async_trait>(
&'life0 self,
session_id: &'life1 str,
limit: Option<usize>,
) -> Pin<Box<dyn Future<Output = Result<Vec<Message>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Get messages for session
Source§fn associate_working_set<'life0, 'life1, 'life2, 'life3, 'life4, 'life5, 'async_trait>(
&'life0 self,
session_id: &'life1 str,
message_id: Option<&'life2 str>,
working_set: &'life3 WorkingSet,
query: &'life4 str,
config: &'life5 CompilerConfig,
) -> Pin<Box<dyn Future<Output = Result<SessionWorkingSet>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
'life5: 'async_trait,
fn associate_working_set<'life0, 'life1, 'life2, 'life3, 'life4, 'life5, 'async_trait>(
&'life0 self,
session_id: &'life1 str,
message_id: Option<&'life2 str>,
working_set: &'life3 WorkingSet,
query: &'life4 str,
config: &'life5 CompilerConfig,
) -> Pin<Box<dyn Future<Output = Result<SessionWorkingSet>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
'life5: 'async_trait,
Associate working set with session
Source§fn get_session_full<'life0, 'life1, 'async_trait>(
&'life0 self,
session_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<SessionWithMessages>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_session_full<'life0, 'life1, 'async_trait>(
&'life0 self,
session_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<SessionWithMessages>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Get full session with messages and working sets
Source§fn register_agent<'life0, 'life1, 'async_trait>(
&'life0 self,
agent: &'life1 Agent,
) -> Pin<Box<dyn Future<Output = Result<Agent>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn register_agent<'life0, 'life1, 'async_trait>(
&'life0 self,
agent: &'life1 Agent,
) -> Pin<Box<dyn Future<Output = Result<Agent>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Register an agent (insert or update)
Source§fn get_agent<'life0, 'life1, 'async_trait>(
&'life0 self,
agent_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<Agent>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_agent<'life0, 'life1, 'async_trait>(
&'life0 self,
agent_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<Agent>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Get agent by ID
Source§fn get_agent_by_name<'life0, 'life1, 'async_trait>(
&'life0 self,
name: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<Agent>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_agent_by_name<'life0, 'life1, 'async_trait>(
&'life0 self,
name: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<Agent>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Get agent by name
Source§fn list_agents<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<Agent>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn list_agents<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<Agent>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
List all registered agents
Source§fn add_agent_relation<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
session_id: &'life1 str,
message_id: &'life2 str,
from_agent_id: &'life3 str,
target_message_id: &'life4 str,
stance: Stance,
) -> Pin<Box<dyn Future<Output = Result<AgentRelation>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
fn add_agent_relation<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
session_id: &'life1 str,
message_id: &'life2 str,
from_agent_id: &'life3 str,
target_message_id: &'life4 str,
stance: Stance,
) -> Pin<Box<dyn Future<Output = Result<AgentRelation>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
Add agent relation (agreement, disagreement, etc.)
Source§fn get_agent_relations<'life0, 'life1, 'async_trait>(
&'life0 self,
session_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<AgentRelationSummary>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_agent_relations<'life0, 'life1, 'async_trait>(
&'life0 self,
session_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<AgentRelationSummary>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Get agent relations for session with resolved names
Auto Trait Implementations§
impl Freeze for SqliteBackend
impl RefUnwindSafe for SqliteBackend
impl Send for SqliteBackend
impl Sync for SqliteBackend
impl Unpin for SqliteBackend
impl UnwindSafe for SqliteBackend
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more