Skip to main content

CombinedGraphBackend

Struct CombinedGraphBackend 

Source
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

Source

pub fn in_memory() -> Result<Self, SqliteGraphError>

Create a new combined backend with an in-memory SQLite authority store.

Source

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.

Source

pub fn from_sqlite_backend(sqlite: SqliteGraphBackend) -> Self

Create a combined backend from an existing SQLite backend.

Source

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.

Source

pub fn from_graph(graph: SqliteGraph) -> Self

Create a combined backend from an existing SqliteGraph.

Source

pub fn from_graph_with_config( graph: SqliteGraph, config: CombinedConfig, ) -> Self

Create a combined backend from an existing SqliteGraph and combined-mode configuration.

Source

pub fn sqlite_backend(&self) -> &SqliteGraphBackend

Access the authoritative SQLite backend used by combined mode.

Source

pub fn graph(&self) -> &SqliteGraph

Access the authoritative SQLite graph used by combined mode.

Source

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

Source§

fn insert_node(&self, node: NodeSpec) -> Result<i64, SqliteGraphError>

Source§

fn insert_edge(&self, edge: EdgeSpec) -> Result<i64, SqliteGraphError>

Source§

fn update_node( &self, node_id: i64, node: NodeSpec, ) -> Result<i64, SqliteGraphError>

Update an existing node in place without allocating a new node ID Read more
Source§

fn delete_entity(&self, id: i64) -> Result<(), SqliteGraphError>

Delete an entity (node) from the graph by ID Read more
Source§

fn entity_ids(&self) -> Result<Vec<i64>, SqliteGraphError>

Get all entity IDs from the graph Read more
Source§

fn get_node( &self, snapshot_id: SnapshotId, id: i64, ) -> Result<GraphEntity, SqliteGraphError>

Source§

fn neighbors( &self, snapshot_id: SnapshotId, node: i64, query: NeighborQuery, ) -> Result<Vec<i64>, SqliteGraphError>

Source§

fn bfs( &self, snapshot_id: SnapshotId, start: i64, depth: u32, ) -> Result<Vec<i64>, SqliteGraphError>

Source§

fn shortest_path( &self, snapshot_id: SnapshotId, start: i64, end: i64, ) -> Result<Option<Vec<i64>>, SqliteGraphError>

Source§

fn node_degree( &self, snapshot_id: SnapshotId, node: i64, ) -> Result<(usize, usize), SqliteGraphError>

Source§

fn k_hop( &self, snapshot_id: SnapshotId, start: i64, depth: u32, direction: BackendDirection, ) -> Result<Vec<i64>, SqliteGraphError>

Source§

fn k_hop_filtered( &self, snapshot_id: SnapshotId, start: i64, depth: u32, direction: BackendDirection, allowed_edge_types: &[&str], ) -> Result<Vec<i64>, SqliteGraphError>

Source§

fn bfs_filtered( &self, snapshot_id: SnapshotId, start: i64, depth: u32, direction: BackendDirection, allowed_edge_types: &[&str], ) -> Result<Vec<i64>, SqliteGraphError>

Source§

fn shortest_path_filtered( &self, snapshot_id: SnapshotId, start: i64, end: i64, allowed_edge_types: &[&str], ) -> Result<Option<Vec<i64>>, SqliteGraphError>

Source§

fn chain_query( &self, snapshot_id: SnapshotId, start: i64, chain: &[ChainStep], ) -> Result<Vec<i64>, SqliteGraphError>

Source§

fn match_triples( &self, pattern: &PatternTriple, ) -> Result<Vec<TripleMatch>, SqliteGraphError>

Match triples based on a pattern triple Read more
Search HNSW vector index for nearest neighbors Read more
Source§

fn get_graph_ref(&self) -> Option<&SqliteGraph>

Get reference to underlying SqliteGraph (if available) Read more
Source§

fn checkpoint(&self) -> Result<(), SqliteGraphError>

Trigger WAL checkpoint for backends that support write-ahead logging Read more
Source§

fn flush(&self) -> Result<(), SqliteGraphError>

Force immediate flush of WAL buffer to disk Read more
Source§

fn backup(&self, backup_dir: &Path) -> Result<BackupResult, SqliteGraphError>

Create a backup of the database Read more
Source§

fn snapshot_export( &self, export_dir: &Path, ) -> Result<SnapshotMetadata, SqliteGraphError>

Export database snapshot to the specified directory Read more
Source§

fn snapshot_import( &self, import_dir: &Path, ) -> Result<ImportMetadata, SqliteGraphError>

Import database snapshot from the specified directory Read more
Source§

fn kv_get( &self, snapshot_id: SnapshotId, key: &[u8], ) -> Result<Option<KvValue>, SqliteGraphError>

Get a value from the KV store at the given snapshot Read more
Source§

fn kv_set( &self, key: Vec<u8>, value: KvValue, ttl_seconds: Option<u64>, ) -> Result<(), SqliteGraphError>

Set a value in the KV store Read more
Source§

fn kv_delete(&self, key: &[u8]) -> Result<(), SqliteGraphError>

Delete a value from the KV store Read more
Source§

fn subscribe( &self, filter: SubscriptionFilter, ) -> Result<(u64, Receiver<PubSubEvent>), SqliteGraphError>

Subscribe to graph change events Read more
Source§

fn unsubscribe(&self, subscriber_id: u64) -> Result<bool, SqliteGraphError>

Unsubscribe from events Read more
Source§

fn kv_prefix_scan( &self, snapshot_id: SnapshotId, prefix: &[u8], ) -> Result<Vec<(Vec<u8>, KvValue)>, SqliteGraphError>

Scan all KV entries with a given prefix Read more
Source§

fn query_nodes_by_kind( &self, snapshot_id: SnapshotId, kind: &str, ) -> Result<Vec<i64>, SqliteGraphError>

Query all nodes with a given kind Read more
Source§

fn query_nodes_by_name_pattern( &self, snapshot_id: SnapshotId, pattern: &str, ) -> Result<Vec<i64>, SqliteGraphError>

Query nodes by name pattern using glob matching Read more
Source§

fn insert_node_with_id( &self, node: NodeSpec, node_id: i64, ) -> Result<i64, SqliteGraphError>

Insert a node with a manually specified ID. Read more
Source§

fn insert_nodes_bulk( &self, nodes: &[NodeSpec], ) -> Result<Vec<i64>, SqliteGraphError>

Insert many nodes atomically. Read more
Source§

fn insert_edges_bulk( &self, edges: &[EdgeSpec], ) -> Result<Vec<i64>, SqliteGraphError>

Insert many edges atomically. Read more
Source§

fn all_entity_ids(&self) -> Result<Vec<i64>, SqliteGraphError>

Alias for entity_ids() for backward compatibility with algorithms Read more
Source§

fn fetch_outgoing(&self, node: i64) -> Result<Vec<i64>, SqliteGraphError>

Get outgoing neighbors for a node (convenience method) Read more
Source§

fn fetch_incoming(&self, node: i64) -> Result<Vec<i64>, SqliteGraphError>

Get incoming neighbors for a node (convenience method) Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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 more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V