pub struct SqliteBackend { /* private fields */ }Expand description
SQLite-based storage backend
This implements the StorageBackend trait using SQLite as the
underlying database. It wraps the existing Storage struct and
delegates to the functions in queries.rs.
Implementations§
Source§impl SqliteBackend
impl SqliteBackend
Sourcepub fn new(config: StorageConfig) -> Result<Self>
pub fn new(config: StorageConfig) -> Result<Self>
Create a new SQLite backend with the given configuration
Sourcepub fn storage_mut(&mut self) -> &mut Storage
pub fn storage_mut(&mut self) -> &mut Storage
Get a mutable reference to the underlying Storage
Trait Implementations§
Source§impl CloudSyncBackend for SqliteBackend
impl CloudSyncBackend for SqliteBackend
Source§fn push(&self) -> Result<SyncResult>
fn push(&self) -> Result<SyncResult>
Push changes to cloud
Source§fn pull(&self) -> Result<SyncResult>
fn pull(&self) -> Result<SyncResult>
Pull changes from cloud
Source§fn sync_state(&self) -> Result<SyncState>
fn sync_state(&self) -> Result<SyncState>
Get current sync state
Source§fn force_sync(&self) -> Result<SyncResult>
fn force_sync(&self) -> Result<SyncResult>
Force a full sync (push then pull)
Source§impl StorageBackend for SqliteBackend
impl StorageBackend for SqliteBackend
Source§fn create_memory(&self, input: CreateMemoryInput) -> Result<Memory>
fn create_memory(&self, input: CreateMemoryInput) -> Result<Memory>
Create a new memory
Source§fn update_memory(
&self,
id: MemoryId,
input: UpdateMemoryInput,
) -> Result<Memory>
fn update_memory( &self, id: MemoryId, input: UpdateMemoryInput, ) -> Result<Memory>
Update a memory
Source§fn create_memories_batch(
&self,
inputs: Vec<CreateMemoryInput>,
) -> Result<BatchCreateResult>
fn create_memories_batch( &self, inputs: Vec<CreateMemoryInput>, ) -> Result<BatchCreateResult>
Create multiple memories in a single transaction
Source§fn delete_memories_batch(&self, ids: Vec<MemoryId>) -> Result<BatchDeleteResult>
fn delete_memories_batch(&self, ids: Vec<MemoryId>) -> Result<BatchDeleteResult>
Delete multiple memories in a single transaction
Source§fn list_memories(&self, options: ListOptions) -> Result<Vec<Memory>>
fn list_memories(&self, options: ListOptions) -> Result<Vec<Memory>>
List memories with filters
Source§fn count_memories(&self, options: ListOptions) -> Result<i64>
fn count_memories(&self, options: ListOptions) -> Result<i64>
Count memories matching filters
Source§fn search_memories(
&self,
query: &str,
options: SearchOptions,
) -> Result<Vec<SearchResult>>
fn search_memories( &self, query: &str, options: SearchOptions, ) -> Result<Vec<SearchResult>>
Search memories using hybrid search
Source§fn create_crossref(
&self,
from_id: MemoryId,
to_id: MemoryId,
edge_type: EdgeType,
score: f32,
) -> Result<CrossReference>
fn create_crossref( &self, from_id: MemoryId, to_id: MemoryId, edge_type: EdgeType, score: f32, ) -> Result<CrossReference>
Create a cross-reference between memories
Source§fn get_crossrefs(&self, memory_id: MemoryId) -> Result<Vec<CrossReference>>
fn get_crossrefs(&self, memory_id: MemoryId) -> Result<Vec<CrossReference>>
Get cross-references for a memory
Source§fn delete_crossref(&self, from_id: MemoryId, to_id: MemoryId) -> Result<()>
fn delete_crossref(&self, from_id: MemoryId, to_id: MemoryId) -> Result<()>
Delete a cross-reference
List all tags with usage counts
Source§fn get_memories_by_tag(
&self,
tag: &str,
limit: Option<usize>,
) -> Result<Vec<Memory>>
fn get_memories_by_tag( &self, tag: &str, limit: Option<usize>, ) -> Result<Vec<Memory>>
Get memories with a specific tag
Source§fn list_workspaces(&self) -> Result<Vec<(String, i64)>>
fn list_workspaces(&self) -> Result<Vec<(String, i64)>>
List all workspaces with memory counts
Source§fn get_workspace_stats(&self, workspace: &str) -> Result<HashMap<String, i64>>
fn get_workspace_stats(&self, workspace: &str) -> Result<HashMap<String, i64>>
Get detailed statistics for a workspace
Source§fn move_to_workspace(
&self,
ids: Vec<MemoryId>,
workspace: &str,
) -> Result<usize>
fn move_to_workspace( &self, ids: Vec<MemoryId>, workspace: &str, ) -> Result<usize>
Move memories to a different workspace
Source§fn get_stats(&self) -> Result<StorageStats>
fn get_stats(&self) -> Result<StorageStats>
Get storage statistics
Source§fn health_check(&self) -> Result<HealthStatus>
fn health_check(&self) -> Result<HealthStatus>
Check storage health
Source§fn backend_name(&self) -> &'static str
fn backend_name(&self) -> &'static str
Get backend name identifier
Source§fn schema_version(&self) -> Result<i32>
fn schema_version(&self) -> Result<i32>
Get current schema version
Source§impl TransactionalBackend for SqliteBackend
impl TransactionalBackend for SqliteBackend
Source§fn with_transaction<F, T>(&self, f: F) -> Result<T>
fn with_transaction<F, T>(&self, f: F) -> Result<T>
Execute a closure within a transaction
Auto Trait Implementations§
impl Freeze for SqliteBackend
impl !RefUnwindSafe for SqliteBackend
impl Send for SqliteBackend
impl Sync for SqliteBackend
impl Unpin for SqliteBackend
impl !UnwindSafe for SqliteBackend
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 moreCreates a shared type from an unshared type.