pub struct SqliteStorage { /* private fields */ }Implementations§
Source§impl SqliteStorage
impl SqliteStorage
pub fn open(path: impl AsRef<Path>) -> Result<Self>
pub fn open_in_memory() -> Result<Self>
Sourcepub fn open_workspace(workspace: impl AsRef<Path>) -> Result<Self>
pub fn open_workspace(workspace: impl AsRef<Path>) -> Result<Self>
Open the default SQLite database inside a workspace directory.
Keeps the concrete filename (semq.db) encapsulated in the storage crate
so callers don’t assume SQLite implementation details.
Trait Implementations§
Source§impl Storage for SqliteStorage
impl Storage for SqliteStorage
Source§fn init(&self, vector_dimension: usize) -> Result<()>
fn init(&self, vector_dimension: usize) -> Result<()>
Initialize all storage tables. Pass
0 to skip creating the vector
table when no embedder is available yet.fn get_document(&self, doc_id: &str) -> Result<Option<Document>>
fn list_documents(&self) -> Result<Vec<Document>>
fn get_document_paths( &self, doc_ids: &[String], ) -> Result<HashMap<String, String>>
fn get_chunks(&self, chunk_ids: &[String]) -> Result<Vec<Chunk>>
fn search_vectors( &self, embedding: &[f32], top_k: usize, ) -> Result<Vec<(String, f32)>>
fn search_text(&self, query: &str, top_k: usize) -> Result<Vec<(String, f32)>>
fn get_model_version(&self, role: ModelRole) -> Result<Option<ModelSpec>>
fn list_collections(&self) -> Result<Vec<Collection>>
fn count_chunks(&self) -> Result<usize>
fn set_model_version_atomic( &self, role: ModelRole, version: &ModelSpec, ) -> Result<()>
fn get_meta(&self, key: &str) -> Result<Option<String>>
fn set_meta_atomic(&self, key: &str, value: &str) -> Result<()>
Source§fn begin_tx(&self) -> Result<Box<dyn StorageTx + '_>>
fn begin_tx(&self) -> Result<Box<dyn StorageTx + '_>>
Begin a write transaction covering
documents / chunks / vec_chunks
/ fts_chunks / model_versions. Operations on the returned StorageTx
are atomic: they either all commit via StorageTx::commit or all roll
back when the transaction is dropped without committing.Auto Trait Implementations§
impl Freeze for SqliteStorage
impl RefUnwindSafe for SqliteStorage
impl Send for SqliteStorage
impl Sync for SqliteStorage
impl Unpin for SqliteStorage
impl UnsafeUnpin for SqliteStorage
impl UnwindSafe for SqliteStorage
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