pub struct SqliteNodeRepository { /* private fields */ }Expand description
SQLite-backed node repository.
Implementations§
Source§impl SqliteNodeRepository
impl SqliteNodeRepository
Sourcepub fn new(conn: Arc<Mutex<Connection>>) -> Self
pub fn new(conn: Arc<Mutex<Connection>>) -> Self
Create a new repository backed by the given connection.
Trait Implementations§
Source§impl Clone for SqliteNodeRepository
impl Clone for SqliteNodeRepository
Source§fn clone(&self) -> SqliteNodeRepository
fn clone(&self) -> SqliteNodeRepository
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SqliteNodeRepository
impl Debug for SqliteNodeRepository
Source§impl NodeRepository for SqliteNodeRepository
impl NodeRepository for SqliteNodeRepository
Source§fn insert(&self, node: &KnowledgeNode) -> Result<KnowledgeNode, StorageError>
fn insert(&self, node: &KnowledgeNode) -> Result<KnowledgeNode, StorageError>
Insert a new node. Returns the node with its assigned ID.
Source§fn get_by_id(&self, id: NodeId) -> Result<KnowledgeNode, StorageError>
fn get_by_id(&self, id: NodeId) -> Result<KnowledgeNode, StorageError>
Get a node by its ID.
Source§fn find_by_nature(
&self,
nature: KnowledgeNature,
) -> Result<Vec<KnowledgeNode>, StorageError>
fn find_by_nature( &self, nature: KnowledgeNature, ) -> Result<Vec<KnowledgeNode>, StorageError>
Find all nodes with the given nature.
Source§fn find_by_branch(
&self,
branch_id: &BranchId,
) -> Result<Vec<KnowledgeNode>, StorageError>
fn find_by_branch( &self, branch_id: &BranchId, ) -> Result<Vec<KnowledgeNode>, StorageError>
Find all nodes belonging to the given branch.
Source§fn update(&self, node: &KnowledgeNode) -> Result<(), StorageError>
fn update(&self, node: &KnowledgeNode) -> Result<(), StorageError>
Update an existing node. The node’s
id field identifies which row to update.Source§fn delete_by_branch(&self, branch_id: &BranchId) -> Result<usize, StorageError>
fn delete_by_branch(&self, branch_id: &BranchId) -> Result<usize, StorageError>
Delete all nodes for the given branch. Returns the number of rows deleted.
Source§fn delete_facts_by_branch(
&self,
branch_id: &BranchId,
) -> Result<usize, StorageError>
fn delete_facts_by_branch( &self, branch_id: &BranchId, ) -> Result<usize, StorageError>
Delete only
fact nodes for a branch (module structure, documentation). Read moreSource§fn delete_auto_detected_by_branch(
&self,
branch_id: &BranchId,
) -> Result<usize, StorageError>
fn delete_auto_detected_by_branch( &self, branch_id: &BranchId, ) -> Result<usize, StorageError>
Delete auto-detected convention nodes for a branch. Read more
Source§fn find_conventions_by_branch(
&self,
branch_id: &BranchId,
) -> Result<Vec<KnowledgeNode>, StorageError>
fn find_conventions_by_branch( &self, branch_id: &BranchId, ) -> Result<Vec<KnowledgeNode>, StorageError>
Find all convention nodes for the given branch. Read more
Auto Trait Implementations§
impl Freeze for SqliteNodeRepository
impl RefUnwindSafe for SqliteNodeRepository
impl Send for SqliteNodeRepository
impl Sync for SqliteNodeRepository
impl Unpin for SqliteNodeRepository
impl UnsafeUnpin for SqliteNodeRepository
impl UnwindSafe for SqliteNodeRepository
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