pub struct DbVectorStore { /* private fields */ }Expand description
Database-backed in-process vector store.
Stores vectors as BLOBs in SQLite and performs cosine similarity in memory.
For production-scale workloads, prefer the Qdrant-backed store.
Implementations§
Trait Implementations§
Source§impl VectorStore for DbVectorStore
impl VectorStore for DbVectorStore
Source§fn ensure_collection(
&self,
collection: &str,
_vector_size: u64,
) -> Pin<Box<dyn Future<Output = Result<(), VectorStoreError>> + Send + '_>>
fn ensure_collection( &self, collection: &str, _vector_size: u64, ) -> Pin<Box<dyn Future<Output = Result<(), VectorStoreError>> + Send + '_>>
Create a collection with cosine-distance vectors of
vector_size dimensions. Read moreSource§fn collection_exists(
&self,
collection: &str,
) -> Pin<Box<dyn Future<Output = Result<bool, VectorStoreError>> + Send + '_>>
fn collection_exists( &self, collection: &str, ) -> Pin<Box<dyn Future<Output = Result<bool, VectorStoreError>> + Send + '_>>
Returns
true if collection exists in the backend.Source§fn delete_collection(
&self,
collection: &str,
) -> Pin<Box<dyn Future<Output = Result<(), VectorStoreError>> + Send + '_>>
fn delete_collection( &self, collection: &str, ) -> Pin<Box<dyn Future<Output = Result<(), VectorStoreError>> + Send + '_>>
Delete a collection and all its points.
Source§fn upsert(
&self,
collection: &str,
points: Vec<VectorPoint>,
) -> Pin<Box<dyn Future<Output = Result<(), VectorStoreError>> + Send + '_>>
fn upsert( &self, collection: &str, points: Vec<VectorPoint>, ) -> Pin<Box<dyn Future<Output = Result<(), VectorStoreError>> + Send + '_>>
Source§fn search(
&self,
collection: &str,
vector: Vec<f32>,
limit: u64,
filter: Option<VectorFilter>,
) -> Pin<Box<dyn Future<Output = Result<Vec<ScoredVectorPoint>, VectorStoreError>> + Send + '_>>
fn search( &self, collection: &str, vector: Vec<f32>, limit: u64, filter: Option<VectorFilter>, ) -> Pin<Box<dyn Future<Output = Result<Vec<ScoredVectorPoint>, VectorStoreError>> + Send + '_>>
Source§fn delete_by_ids(
&self,
collection: &str,
ids: Vec<String>,
) -> Pin<Box<dyn Future<Output = Result<(), VectorStoreError>> + Send + '_>>
fn delete_by_ids( &self, collection: &str, ids: Vec<String>, ) -> Pin<Box<dyn Future<Output = Result<(), VectorStoreError>> + Send + '_>>
Delete specific points from
collection by their string IDs.Source§fn scroll_all(
&self,
collection: &str,
key_field: &str,
) -> Pin<Box<dyn Future<Output = Result<ScrollResult, VectorStoreError>> + Send + '_>>
fn scroll_all( &self, collection: &str, key_field: &str, ) -> Pin<Box<dyn Future<Output = Result<ScrollResult, VectorStoreError>> + Send + '_>>
Scroll (paginate) all points in
collection and return a map of
point_id → { key_field → value } payload entries.Source§fn health_check(
&self,
) -> Pin<Box<dyn Future<Output = Result<bool, VectorStoreError>> + Send + '_>>
fn health_check( &self, ) -> Pin<Box<dyn Future<Output = Result<bool, VectorStoreError>> + Send + '_>>
Return
true if the backend is reachable and operational.Auto Trait Implementations§
impl Freeze for DbVectorStore
impl !RefUnwindSafe for DbVectorStore
impl Send for DbVectorStore
impl Sync for DbVectorStore
impl Unpin for DbVectorStore
impl UnsafeUnpin for DbVectorStore
impl !UnwindSafe for DbVectorStore
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request