pub struct SqliteGraphBackend { /* private fields */ }Expand description
SQLite-backed implementation of the GraphBackend trait.
This struct wraps a SqliteGraph instance and implements all GraphBackend methods by delegating to the underlying SQLite-based graph operations.
Implementations§
Source§impl SqliteGraphBackend
impl SqliteGraphBackend
Sourcepub fn in_memory() -> Result<Self, SqliteGraphError>
pub fn in_memory() -> Result<Self, SqliteGraphError>
Create a new SQLite backend with an in-memory database.
Sourcepub fn from_graph(graph: SqliteGraph) -> Self
pub fn from_graph(graph: SqliteGraph) -> Self
Create a new SQLite backend from an existing SqliteGraph instance.
Sourcepub fn graph(&self) -> &SqliteGraph
pub fn graph(&self) -> &SqliteGraph
Get a reference to the underlying SqliteGraph instance.
Sourcepub fn entity_ids(&self) -> Result<Vec<i64>, SqliteGraphError>
pub fn entity_ids(&self) -> Result<Vec<i64>, SqliteGraphError>
Get all entity IDs from the graph.
Trait Implementations§
Source§impl GraphBackend for SqliteGraphBackend
impl GraphBackend for SqliteGraphBackend
fn insert_node(&self, node: NodeSpec) -> Result<i64, SqliteGraphError>
fn get_node(&self, id: i64) -> Result<GraphEntity, SqliteGraphError>
fn insert_edge(&self, edge: EdgeSpec) -> Result<i64, SqliteGraphError>
fn neighbors( &self, node: i64, query: NeighborQuery, ) -> Result<Vec<i64>, SqliteGraphError>
fn bfs(&self, start: i64, depth: u32) -> Result<Vec<i64>, SqliteGraphError>
fn shortest_path( &self, start: i64, end: i64, ) -> Result<Option<Vec<i64>>, SqliteGraphError>
fn node_degree(&self, node: i64) -> Result<(usize, usize), SqliteGraphError>
fn k_hop( &self, start: i64, depth: u32, direction: BackendDirection, ) -> Result<Vec<i64>, SqliteGraphError>
fn k_hop_filtered( &self, start: i64, depth: u32, direction: BackendDirection, allowed_edge_types: &[&str], ) -> Result<Vec<i64>, SqliteGraphError>
fn chain_query( &self, start: i64, chain: &[ChainStep], ) -> Result<Vec<i64>, SqliteGraphError>
fn pattern_search( &self, start: i64, pattern: &PatternQuery, ) -> Result<Vec<PatternMatch>, SqliteGraphError>
Auto Trait Implementations§
impl !Freeze for SqliteGraphBackend
impl !RefUnwindSafe for SqliteGraphBackend
impl Send for SqliteGraphBackend
impl !Sync for SqliteGraphBackend
impl Unpin for SqliteGraphBackend
impl !UnwindSafe for SqliteGraphBackend
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