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.
pub fn insert_node(&self, node: &GraphNode) -> Result<(), GraphError>
pub fn update_node_in_db(&self, node: &GraphNode) -> Result<(), GraphError>
Trait Implementations§
Source§impl GraphStore for SqliteGraphStore
impl GraphStore for SqliteGraphStore
Source§fn get_edges(&self, node_id: u64, direction: EdgeDirection) -> Vec<GraphEdge>
fn get_edges(&self, node_id: u64, direction: EdgeDirection) -> Vec<GraphEdge>
Get edges connected to a node in the specified direction.
Source§fn get_module_profile(&self, module_id: u64) -> Option<ModuleProfile>
fn get_module_profile(&self, module_id: u64) -> Option<ModuleProfile>
Get the module profile for a given module node.
Source§fn get_nodes_in_file(&self, file_path: &str) -> Vec<GraphNode>
fn get_nodes_in_file(&self, file_path: &str) -> Vec<GraphNode>
Get all nodes in a specific file.
Source§fn get_all_modules(&self) -> Vec<GraphNode>
fn get_all_modules(&self) -> Vec<GraphNode>
Get all module-type nodes in the graph.
Source§fn update_nodes(&mut self, changes: Vec<NodeChange>) -> Result<(), GraphError>
fn update_nodes(&mut self, changes: Vec<NodeChange>) -> Result<(), GraphError>
Apply a batch of node changes (add, update, remove).
Source§fn update_edges(&mut self, changes: Vec<EdgeChange>) -> Result<(), GraphError>
fn update_edges(&mut self, changes: Vec<EdgeChange>) -> Result<(), GraphError>
Apply a batch of edge changes (add, remove).
Source§fn get_previous_hashes(&self, node_id: u64) -> Vec<String>
fn get_previous_hashes(&self, node_id: u64) -> Vec<String>
Get previous hashes for rename tracking.
Source§fn find_modules_by_prefix(
&self,
prefix: &str,
exclude_file: &str,
) -> Vec<ModuleProfile>
fn find_modules_by_prefix( &self, prefix: &str, exclude_file: &str, ) -> Vec<ModuleProfile>
Find modules whose function_name_prefixes contain the given prefix,
excluding modules in the specified file. Used by W001 placement check.
Auto Trait Implementations§
impl !Freeze for SqliteGraphStore
impl !RefUnwindSafe for SqliteGraphStore
impl Send for SqliteGraphStore
impl !Sync for SqliteGraphStore
impl Unpin for SqliteGraphStore
impl UnsafeUnpin for SqliteGraphStore
impl !UnwindSafe for SqliteGraphStore
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