pub struct SqliteGraphStore { /* private fields */ }Expand description
SQLite-backed implementation of the GraphStore trait.
Implementations§
Source§impl SqliteGraphStore
impl SqliteGraphStore
Sourcepub fn open(path: &str) -> Result<Self, GraphError>
pub fn open(path: &str) -> Result<Self, GraphError>
Open or create a graph database at the given path.
Sourcepub fn in_memory() -> Result<Self, GraphError>
pub fn in_memory() -> Result<Self, GraphError>
Create an in-memory graph database (for testing).
Sourcepub fn set_foreign_keys(&self, enabled: bool) -> Result<bool, GraphError>
pub fn set_foreign_keys(&self, enabled: bool) -> Result<bool, GraphError>
Temporarily disable foreign key enforcement (for bulk re-map operations). Returns the actual FK state after the change (for verification).
Sourcepub fn schema_version(&self) -> Result<u32, GraphError>
pub fn schema_version(&self) -> Result<u32, GraphError>
Get the current schema version.
Sourcepub fn cleanup_orphaned_edges(&self) -> Result<u64, GraphError>
pub fn cleanup_orphaned_edges(&self) -> Result<u64, GraphError>
Remove edges whose source or target node no longer exists.
Sourcepub fn clear_all(&mut self) -> Result<(), GraphError>
pub fn clear_all(&mut self) -> Result<(), GraphError>
Clear all graph data (nodes, edges, etc.) for a full re-map. Preserves schema and metadata.
Sourcepub fn upsert_module_profiles(
&self,
profiles: Vec<ModuleProfile>,
) -> Result<(), GraphError>
pub fn upsert_module_profiles( &self, profiles: Vec<ModuleProfile>, ) -> Result<(), GraphError>
Insert or update module profiles in bulk. Uses INSERT … ON CONFLICT DO UPDATE for upsert semantics.
Source§impl SqliteGraphStore
impl SqliteGraphStore
Sourcepub fn load_circuit_breaker(
&self,
) -> Result<Vec<(String, String, u32, bool)>, GraphError>
pub fn load_circuit_breaker( &self, ) -> Result<Vec<(String, String, u32, bool)>, GraphError>
Load circuit breaker state from the database.
Sourcepub fn save_circuit_breaker(
&self,
state: &[(String, String, u32, bool)],
) -> Result<(), GraphError>
pub fn save_circuit_breaker( &self, state: &[(String, String, u32, bool)], ) -> Result<(), GraphError>
Save circuit breaker state, replacing all existing rows.
Sourcepub fn search_nodes(
&self,
query: &str,
kind_filter: Option<&str>,
limit: usize,
) -> Vec<GraphNode>
pub fn search_nodes( &self, query: &str, kind_filter: Option<&str>, limit: usize, ) -> Vec<GraphNode>
Search for nodes whose name contains the given substring (case-insensitive). Single SQL query instead of iterating modules + per-file lookups (N+1).
Sourcepub fn insert_node(&self, node: &GraphNode) -> Result<(), GraphError>
pub fn insert_node(&self, node: &GraphNode) -> Result<(), GraphError>
Insert a node into the database, or update it on hash conflict (upsert).
Sourcepub fn update_node_in_db(&self, node: &GraphNode) -> Result<(), GraphError>
pub fn update_node_in_db(&self, node: &GraphNode) -> Result<(), GraphError>
Update an existing node by ID, preserving the old hash in previous_hashes.