pub struct SqliteStore { /* private fields */ }Expand description
Combined document store + BM25 index backed by SQLite.
Replaces the pattern of BM25Index + VectorStore + JSON persistence
for users who want disk-backed RAG without managing separate components.
Implementations§
Source§impl SqliteStore
impl SqliteStore
Sourcepub fn open_in_memory() -> Result<Self>
pub fn open_in_memory() -> Result<Self>
Open an in-memory store (for testing).
Sourcepub fn index_document(
&self,
doc: &Document,
chunks: &[Chunk],
fingerprint: Option<(&str, &[u8; 32])>,
) -> Result<()>
pub fn index_document( &self, doc: &Document, chunks: &[Chunk], fingerprint: Option<(&str, &[u8; 32])>, ) -> Result<()>
Index a document with its pre-chunked content.
Sourcepub fn search(&self, query: &str, k: usize) -> Result<Vec<FtsResult>>
pub fn search(&self, query: &str, k: usize) -> Result<Vec<FtsResult>>
Search with BM25 and return results.
Performance contract: Median latency 10–50 ms (spec Section 3.1).
Sourcepub fn needs_reindex(&self, path: &str, hash: &[u8; 32]) -> Result<bool>
pub fn needs_reindex(&self, path: &str, hash: &[u8; 32]) -> Result<bool>
Check if a document needs reindexing by fingerprint.
Sourcepub fn list_fingerprints(&self) -> Result<Vec<(String, Vec<u8>)>>
pub fn list_fingerprints(&self) -> Result<Vec<(String, Vec<u8>)>>
List all tracked fingerprints.
Sourcepub fn remove_by_source(&self, source: &str) -> Result<usize>
pub fn remove_by_source(&self, source: &str) -> Result<usize>
Remove all documents with a given source path.
Sourcepub fn stats(&self) -> Result<StoreStats>
pub fn stats(&self) -> Result<StoreStats>
Get store statistics.
Sourcepub fn set_metadata(&self, key: &str, value: &str) -> Result<()>
pub fn set_metadata(&self, key: &str, value: &str) -> Result<()>
Set a metadata key-value pair.
Sourcepub fn as_index(&self) -> &SqliteIndex
pub fn as_index(&self) -> &SqliteIndex
Get a reference to the underlying SqliteIndex.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for SqliteStore
impl RefUnwindSafe for SqliteStore
impl Send for SqliteStore
impl Sync for SqliteStore
impl Unpin for SqliteStore
impl UnsafeUnpin for SqliteStore
impl UnwindSafe for SqliteStore
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