pub struct SqliteAppStore {
config: Config,
pool: SqlitePool,
}Expand description
SQLite-backed AppStore implementation.
Fields§
§config: Config§pool: SqlitePoolImplementations§
Source§impl SqliteAppStore
impl SqliteAppStore
pub async fn connect(config: &Config) -> Result<Self>
pub async fn initialize_config(config: &Config) -> Result<()>
pub fn pool(&self) -> &SqlitePool
Sourcepub fn agent_runs(&self, workspace_id: &str) -> Result<AgentRunStore>
pub fn agent_runs(&self, workspace_id: &str) -> Result<AgentRunStore>
Runtime history uses the same canonical database as ingestion/retrieval.
Sourcepub fn agent_tasks(&self, workspace_id: &str) -> Result<AgentTaskStore>
pub fn agent_tasks(&self, workspace_id: &str) -> Result<AgentTaskStore>
Accepted background tasks share the canonical database but remain workspace-scoped and distinct from concrete run attempts.
pub async fn close(&self)
fn core_store(&self) -> SqliteStore
Sourcepub(crate) async fn replace_source_item_atomic(
&self,
item: &SourceItem,
max_tokens: usize,
) -> Result<CanonicalDocumentWrite>
pub(crate) async fn replace_source_item_atomic( &self, item: &SourceItem, max_tokens: usize, ) -> Result<CanonicalDocumentWrite>
Atomically replace one canonical document and all of its searchable chunks.
Trait Implementations§
Source§impl AppStore for SqliteAppStore
impl AppStore for SqliteAppStore
fn initialize<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_checkpoint<'life0, 'life1, 'async_trait>(
&'life0 self,
source: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<i64>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn set_checkpoint<'life0, 'life1, 'async_trait>(
&'life0 self,
source: &'life1 str,
cursor: i64,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn upsert_source_item<'life0, 'life1, 'async_trait>(
&'life0 self,
item: &'life1 SourceItem,
) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn find_pending_chunks<'life0, 'life1, 'async_trait>(
&'life0 self,
model: &'life1 str,
limit: Option<usize>,
) -> Pin<Box<dyn Future<Output = Result<Vec<PendingChunk>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_embedding_hash<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
chunk_id: &'life1 str,
model: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<Option<String>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn clear_embeddings<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn stats<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<StoreStats>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn export_index<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<ExportData>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§impl Store for SqliteAppStore
impl Store for SqliteAppStore
Source§fn upsert_document<'life0, 'life1, 'async_trait>(
&'life0 self,
doc: &'life1 Document,
) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn upsert_document<'life0, 'life1, 'async_trait>(
&'life0 self,
doc: &'life1 Document,
) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Insert or update a document. Read more
Source§fn replace_chunks<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
doc_id: &'life1 str,
chunks: &'life2 [Chunk],
vectors: Option<&'life3 [Vec<f32>]>,
) -> 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 replace_chunks<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
doc_id: &'life1 str,
chunks: &'life2 [Chunk],
vectors: Option<&'life3 [Vec<f32>]>,
) -> 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,
Replace all chunks for a document, optionally storing vectors.
Source§fn upsert_embedding<'life0, 'life1, 'life2, 'life3, 'life4, 'life5, 'async_trait>(
&'life0 self,
chunk_id: &'life1 str,
doc_id: &'life2 str,
vector: &'life3 [f32],
model: &'life4 str,
dims: usize,
content_hash: &'life5 str,
) -> 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,
'life4: 'async_trait,
'life5: 'async_trait,
fn upsert_embedding<'life0, 'life1, 'life2, 'life3, 'life4, 'life5, 'async_trait>(
&'life0 self,
chunk_id: &'life1 str,
doc_id: &'life2 str,
vector: &'life3 [f32],
model: &'life4 str,
dims: usize,
content_hash: &'life5 str,
) -> 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,
'life4: 'async_trait,
'life5: 'async_trait,
Store or update an embedding vector for a chunk.
Source§fn get_document<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<DocumentResponse>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_document<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<DocumentResponse>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Retrieve a full document with all its chunks, by ID.
Source§fn get_document_metadata<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<DocumentMetadata>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_document_metadata<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<DocumentMetadata>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Retrieve lightweight metadata for a document, by ID.
Source§fn keyword_search<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
query: &'life1 str,
limit: i64,
source: Option<&'life2 str>,
since: Option<&'life3 str>,
) -> Pin<Box<dyn Future<Output = Result<Vec<ChunkCandidate>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn keyword_search<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
query: &'life1 str,
limit: i64,
source: Option<&'life2 str>,
since: Option<&'life3 str>,
) -> Pin<Box<dyn Future<Output = Result<Vec<ChunkCandidate>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Perform keyword (full-text) search, returning candidate chunks.
Source§fn vector_search<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
query_vec: &'life1 [f32],
limit: i64,
source: Option<&'life2 str>,
since: Option<&'life3 str>,
) -> Pin<Box<dyn Future<Output = Result<Vec<ChunkCandidate>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn vector_search<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
query_vec: &'life1 [f32],
limit: i64,
source: Option<&'life2 str>,
since: Option<&'life3 str>,
) -> Pin<Box<dyn Future<Output = Result<Vec<ChunkCandidate>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Perform vector similarity search, returning candidate chunks.
Auto Trait Implementations§
impl !RefUnwindSafe for SqliteAppStore
impl !UnwindSafe for SqliteAppStore
impl Freeze for SqliteAppStore
impl Send for SqliteAppStore
impl Sync for SqliteAppStore
impl Unpin for SqliteAppStore
impl UnsafeUnpin for SqliteAppStore
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
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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