pub struct CombinedGraphBackend { /* private fields */ }Expand description
SQLite-authoritative backend mode.
In the current Phase 2 slice, this is an explicit composition point over the SQLite backend. It preserves today’s SQLite execution behavior while giving combined mode its own public type and future materialization seam.
Implementations§
Source§impl CombinedGraphBackend
impl CombinedGraphBackend
Sourcepub fn in_memory() -> Result<Self, SqliteGraphError>
pub fn in_memory() -> Result<Self, SqliteGraphError>
Create a new combined backend with an in-memory SQLite authority store.
Sourcepub fn in_memory_with_config(
config: CombinedConfig,
) -> Result<Self, SqliteGraphError>
pub fn in_memory_with_config( config: CombinedConfig, ) -> Result<Self, SqliteGraphError>
Create a new combined backend with an in-memory SQLite authority store and explicit combined-mode configuration.
Sourcepub fn from_sqlite_backend(sqlite: SqliteGraphBackend) -> Self
pub fn from_sqlite_backend(sqlite: SqliteGraphBackend) -> Self
Create a combined backend from an existing SQLite backend.
Sourcepub fn from_sqlite_backend_with_config(
sqlite: SqliteGraphBackend,
config: CombinedConfig,
) -> Self
pub fn from_sqlite_backend_with_config( sqlite: SqliteGraphBackend, config: CombinedConfig, ) -> Self
Create a combined backend from an existing SQLite backend and combined-mode configuration.
Sourcepub fn from_graph(graph: SqliteGraph) -> Self
pub fn from_graph(graph: SqliteGraph) -> Self
Create a combined backend from an existing SqliteGraph.
Sourcepub fn from_graph_with_config(
graph: SqliteGraph,
config: CombinedConfig,
) -> Self
pub fn from_graph_with_config( graph: SqliteGraph, config: CombinedConfig, ) -> Self
Create a combined backend from an existing SqliteGraph and
combined-mode configuration.
Sourcepub fn sqlite_backend(&self) -> &SqliteGraphBackend
pub fn sqlite_backend(&self) -> &SqliteGraphBackend
Access the authoritative SQLite backend used by combined mode.
Sourcepub fn graph(&self) -> &SqliteGraph
pub fn graph(&self) -> &SqliteGraph
Access the authoritative SQLite graph used by combined mode.
Sourcepub fn publish_materialized_views(&self) -> Result<i64, SqliteGraphError>
pub fn publish_materialized_views(&self) -> Result<i64, SqliteGraphError>
Rebuild and publish combined-mode materialized traversal views from authoritative SQLite truth.
Returns the published materialized version, which matches the current authoritative SQLite version at publish time.
Trait Implementations§
Source§impl GraphBackend for CombinedGraphBackend
impl GraphBackend for CombinedGraphBackend
fn insert_node(&self, node: NodeSpec) -> Result<i64, SqliteGraphError>
fn insert_edge(&self, edge: EdgeSpec) -> Result<i64, SqliteGraphError>
Source§fn update_node(
&self,
node_id: i64,
node: NodeSpec,
) -> Result<i64, SqliteGraphError>
fn update_node( &self, node_id: i64, node: NodeSpec, ) -> Result<i64, SqliteGraphError>
Source§fn delete_entity(&self, id: i64) -> Result<(), SqliteGraphError>
fn delete_entity(&self, id: i64) -> Result<(), SqliteGraphError>
Source§fn entity_ids(&self) -> Result<Vec<i64>, SqliteGraphError>
fn entity_ids(&self) -> Result<Vec<i64>, SqliteGraphError>
fn get_node( &self, snapshot_id: SnapshotId, id: i64, ) -> Result<GraphEntity, SqliteGraphError>
fn neighbors( &self, snapshot_id: SnapshotId, node: i64, query: NeighborQuery, ) -> Result<Vec<i64>, SqliteGraphError>
fn bfs( &self, snapshot_id: SnapshotId, start: i64, depth: u32, ) -> Result<Vec<i64>, SqliteGraphError>
fn shortest_path( &self, snapshot_id: SnapshotId, start: i64, end: i64, ) -> Result<Option<Vec<i64>>, SqliteGraphError>
fn node_degree( &self, snapshot_id: SnapshotId, node: i64, ) -> Result<(usize, usize), SqliteGraphError>
fn k_hop( &self, snapshot_id: SnapshotId, start: i64, depth: u32, direction: BackendDirection, ) -> Result<Vec<i64>, SqliteGraphError>
fn k_hop_filtered( &self, snapshot_id: SnapshotId, start: i64, depth: u32, direction: BackendDirection, allowed_edge_types: &[&str], ) -> Result<Vec<i64>, SqliteGraphError>
fn bfs_filtered( &self, snapshot_id: SnapshotId, start: i64, depth: u32, direction: BackendDirection, allowed_edge_types: &[&str], ) -> Result<Vec<i64>, SqliteGraphError>
fn shortest_path_filtered( &self, snapshot_id: SnapshotId, start: i64, end: i64, allowed_edge_types: &[&str], ) -> Result<Option<Vec<i64>>, SqliteGraphError>
fn chain_query( &self, snapshot_id: SnapshotId, start: i64, chain: &[ChainStep], ) -> Result<Vec<i64>, SqliteGraphError>
fn pattern_search( &self, snapshot_id: SnapshotId, start: i64, pattern: &PatternQuery, ) -> Result<Vec<PatternMatch>, SqliteGraphError>
Source§fn match_triples(
&self,
pattern: &PatternTriple,
) -> Result<Vec<TripleMatch>, SqliteGraphError>
fn match_triples( &self, pattern: &PatternTriple, ) -> Result<Vec<TripleMatch>, SqliteGraphError>
Source§fn vector_search(
&self,
snapshot: SnapshotId,
index_name: &str,
vector: &[f32],
k: usize,
) -> Result<Vec<(i64, f32)>, SqliteGraphError>
fn vector_search( &self, snapshot: SnapshotId, index_name: &str, vector: &[f32], k: usize, ) -> Result<Vec<(i64, f32)>, SqliteGraphError>
Source§fn get_graph_ref(&self) -> Option<&SqliteGraph>
fn get_graph_ref(&self) -> Option<&SqliteGraph>
Source§fn checkpoint(&self) -> Result<(), SqliteGraphError>
fn checkpoint(&self) -> Result<(), SqliteGraphError>
Source§fn flush(&self) -> Result<(), SqliteGraphError>
fn flush(&self) -> Result<(), SqliteGraphError>
Source§fn backup(&self, backup_dir: &Path) -> Result<BackupResult, SqliteGraphError>
fn backup(&self, backup_dir: &Path) -> Result<BackupResult, SqliteGraphError>
Source§fn snapshot_export(
&self,
export_dir: &Path,
) -> Result<SnapshotMetadata, SqliteGraphError>
fn snapshot_export( &self, export_dir: &Path, ) -> Result<SnapshotMetadata, SqliteGraphError>
Source§fn snapshot_import(
&self,
import_dir: &Path,
) -> Result<ImportMetadata, SqliteGraphError>
fn snapshot_import( &self, import_dir: &Path, ) -> Result<ImportMetadata, SqliteGraphError>
Source§fn kv_get(
&self,
snapshot_id: SnapshotId,
key: &[u8],
) -> Result<Option<KvValue>, SqliteGraphError>
fn kv_get( &self, snapshot_id: SnapshotId, key: &[u8], ) -> Result<Option<KvValue>, SqliteGraphError>
Source§fn kv_set(
&self,
key: Vec<u8>,
value: KvValue,
ttl_seconds: Option<u64>,
) -> Result<(), SqliteGraphError>
fn kv_set( &self, key: Vec<u8>, value: KvValue, ttl_seconds: Option<u64>, ) -> Result<(), SqliteGraphError>
Source§fn kv_delete(&self, key: &[u8]) -> Result<(), SqliteGraphError>
fn kv_delete(&self, key: &[u8]) -> Result<(), SqliteGraphError>
Source§fn subscribe(
&self,
filter: SubscriptionFilter,
) -> Result<(u64, Receiver<PubSubEvent>), SqliteGraphError>
fn subscribe( &self, filter: SubscriptionFilter, ) -> Result<(u64, Receiver<PubSubEvent>), SqliteGraphError>
Source§fn unsubscribe(&self, subscriber_id: u64) -> Result<bool, SqliteGraphError>
fn unsubscribe(&self, subscriber_id: u64) -> Result<bool, SqliteGraphError>
Source§fn kv_prefix_scan(
&self,
snapshot_id: SnapshotId,
prefix: &[u8],
) -> Result<Vec<(Vec<u8>, KvValue)>, SqliteGraphError>
fn kv_prefix_scan( &self, snapshot_id: SnapshotId, prefix: &[u8], ) -> Result<Vec<(Vec<u8>, KvValue)>, SqliteGraphError>
Source§fn query_nodes_by_kind(
&self,
snapshot_id: SnapshotId,
kind: &str,
) -> Result<Vec<i64>, SqliteGraphError>
fn query_nodes_by_kind( &self, snapshot_id: SnapshotId, kind: &str, ) -> Result<Vec<i64>, SqliteGraphError>
Source§fn query_nodes_by_name_pattern(
&self,
snapshot_id: SnapshotId,
pattern: &str,
) -> Result<Vec<i64>, SqliteGraphError>
fn query_nodes_by_name_pattern( &self, snapshot_id: SnapshotId, pattern: &str, ) -> Result<Vec<i64>, SqliteGraphError>
Source§fn insert_node_with_id(
&self,
node: NodeSpec,
node_id: i64,
) -> Result<i64, SqliteGraphError>
fn insert_node_with_id( &self, node: NodeSpec, node_id: i64, ) -> Result<i64, SqliteGraphError>
Source§fn insert_nodes_bulk(
&self,
nodes: &[NodeSpec],
) -> Result<Vec<i64>, SqliteGraphError>
fn insert_nodes_bulk( &self, nodes: &[NodeSpec], ) -> Result<Vec<i64>, SqliteGraphError>
Source§fn insert_edges_bulk(
&self,
edges: &[EdgeSpec],
) -> Result<Vec<i64>, SqliteGraphError>
fn insert_edges_bulk( &self, edges: &[EdgeSpec], ) -> Result<Vec<i64>, SqliteGraphError>
Source§fn all_entity_ids(&self) -> Result<Vec<i64>, SqliteGraphError>
fn all_entity_ids(&self) -> Result<Vec<i64>, SqliteGraphError>
entity_ids() for backward compatibility with algorithms Read moreSource§fn fetch_outgoing(&self, node: i64) -> Result<Vec<i64>, SqliteGraphError>
fn fetch_outgoing(&self, node: i64) -> Result<Vec<i64>, SqliteGraphError>
Source§fn fetch_incoming(&self, node: i64) -> Result<Vec<i64>, SqliteGraphError>
fn fetch_incoming(&self, node: i64) -> Result<Vec<i64>, SqliteGraphError>
Auto Trait Implementations§
impl !Freeze for CombinedGraphBackend
impl !RefUnwindSafe for CombinedGraphBackend
impl !Sync for CombinedGraphBackend
impl !UnwindSafe for CombinedGraphBackend
impl Send for CombinedGraphBackend
impl Unpin for CombinedGraphBackend
impl UnsafeUnpin for CombinedGraphBackend
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
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>
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>
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 more