pub struct SqliteStore { /* private fields */ }Available on crate feature
sqlite only.Expand description
SQLite persistent Store with FTS5 full-text search and optional vector search
Implementations§
Source§impl SqliteStore
impl SqliteStore
Sourcepub fn new(path: impl AsRef<Path>) -> Result<SqliteStore, ReactError>
pub fn new(path: impl AsRef<Path>) -> Result<SqliteStore, ReactError>
Open or create a SQLite database, auto-create tables and FTS5 index
Sourcepub fn with_embedder(
path: impl AsRef<Path>,
embedder: Arc<dyn Embedder>,
) -> Result<SqliteStore, ReactError>
pub fn with_embedder( path: impl AsRef<Path>, embedder: Arc<dyn Embedder>, ) -> Result<SqliteStore, ReactError>
Open or create a SQLite database with vector search enabled
Trait Implementations§
Source§impl Store for SqliteStore
impl Store for SqliteStore
Source§fn put<'a>(
&'a self,
namespace: &'a [&'a str],
key: &'a str,
value: Value,
) -> Pin<Box<dyn Future<Output = Result<(), ReactError>> + Send + 'a>>
fn put<'a>( &'a self, namespace: &'a [&'a str], key: &'a str, value: Value, ) -> Pin<Box<dyn Future<Output = Result<(), ReactError>> + Send + 'a>>
Write or update a record (upsert)
Source§fn get<'a>(
&'a self,
namespace: &'a [&'a str],
key: &'a str,
) -> Pin<Box<dyn Future<Output = Result<Option<StoreItem>, ReactError>> + Send + 'a>>
fn get<'a>( &'a self, namespace: &'a [&'a str], key: &'a str, ) -> Pin<Box<dyn Future<Output = Result<Option<StoreItem>, ReactError>> + Send + 'a>>
Exact fetch by key
Source§fn search<'a>(
&'a self,
namespace: &'a [&'a str],
query: &'a str,
limit: usize,
) -> Pin<Box<dyn Future<Output = Result<Vec<StoreItem>, ReactError>> + Send + 'a>>
fn search<'a>( &'a self, namespace: &'a [&'a str], query: &'a str, limit: usize, ) -> Pin<Box<dyn Future<Output = Result<Vec<StoreItem>, ReactError>> + Send + 'a>>
Keyword search, returns at most
limit items (sorted by relevance)Source§fn delete<'a>(
&'a self,
namespace: &'a [&'a str],
key: &'a str,
) -> Pin<Box<dyn Future<Output = Result<bool, ReactError>> + Send + 'a>>
fn delete<'a>( &'a self, namespace: &'a [&'a str], key: &'a str, ) -> Pin<Box<dyn Future<Output = Result<bool, ReactError>> + Send + 'a>>
Delete the specified key, returns whether it existed and was deleted
Source§fn list_namespaces<'a>(
&'a self,
prefix: Option<&'a [&'a str]>,
) -> Pin<Box<dyn Future<Output = Result<Vec<Vec<String>>, ReactError>> + Send + 'a>>
fn list_namespaces<'a>( &'a self, prefix: Option<&'a [&'a str]>, ) -> Pin<Box<dyn Future<Output = Result<Vec<Vec<String>>, ReactError>> + Send + 'a>>
List all namespaces matching the given
prefixSource§fn list<'a>(
&'a self,
namespace: &'a [&'a str],
) -> Pin<Box<dyn Future<Output = Result<Vec<StoreItem>, ReactError>> + Send + 'a>>
fn list<'a>( &'a self, namespace: &'a [&'a str], ) -> Pin<Box<dyn Future<Output = Result<Vec<StoreItem>, ReactError>> + Send + 'a>>
List all entries in the namespace (no keyword filter, no pagination limit).
Source§fn search_with<'a>(
&'a self,
namespace: &'a [&'a str],
query: SearchQuery<'a>,
) -> Pin<Box<dyn Future<Output = Result<Vec<StoreItem>, ReactError>> + Send + 'a>>
fn search_with<'a>( &'a self, namespace: &'a [&'a str], query: SearchQuery<'a>, ) -> Pin<Box<dyn Future<Output = Result<Vec<StoreItem>, ReactError>> + Send + 'a>>
Unified search entry point. Read more
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> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
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