pub struct GraphDb {
pub conn: Connection,
pub repo_id: String,
pub db_path: PathBuf,
}Fields§
§conn: Connection§repo_id: String§db_path: PathBufImplementations§
Source§impl GraphDb
impl GraphDb
pub fn open(repo_path: &Path) -> Result<Self>
pub fn upsert_nodes(&self, nodes: &[Node]) -> Result<usize>
pub fn upsert_edges(&self, edges: &[Edge]) -> Result<usize>
pub fn get_node(&self, id: &str) -> Result<Option<Node>>
pub fn get_neighbors(&self, id: &str, depth: u8) -> Result<Vec<Node>>
pub fn get_all_nodes(&self) -> Result<Vec<Node>>
pub fn get_all_edges(&self) -> Result<Vec<Edge>>
pub fn node_count(&self) -> Result<u64>
pub fn edge_count(&self) -> Result<u64>
pub fn clear(&self) -> Result<()>
pub fn get_language_breakdown(&self) -> Result<HashMap<String, f64>>
pub fn get_node_counts_by_kind(&self) -> Result<HashMap<String, u64>>
pub fn upsert_node_scores( &self, node_id: &str, churn: f64, coupling: f64, ) -> Result<()>
pub fn update_in_out_degrees(&self) -> Result<()>
pub fn get_hotspots(&self, limit: usize) -> Result<Vec<(String, f64, f64, i64)>>
pub fn get_ownership(&self) -> Result<Vec<(String, i64)>>
pub fn compute_coupling(&self) -> Result<()>
pub fn update_node_communities( &self, communities: &HashMap<String, i64>, ) -> Result<usize>
pub fn get_stats(&self) -> Result<RepoStats>
pub fn get_entry_points(&self, limit: usize) -> Result<Vec<Node>>
pub fn get_god_nodes(&self, limit: usize) -> Result<Vec<Node>>
pub fn get_communities(&self) -> Result<Vec<CommunityRow>>
pub fn clear_communities(&self) -> Result<()>
Sourcepub fn get_dependents(&self, id: &str, depth: u8) -> Result<Vec<Node>>
pub fn get_dependents(&self, id: &str, depth: u8) -> Result<Vec<Node>>
BFS following only incoming edges — returns all nodes that depend on id.
Used for blast-radius analysis: if id changes, these nodes are affected.
pub fn get_nodes_by_community(&self, community: i64) -> Result<Vec<Node>>
pub fn mark_dead_candidates(&self, items: &[(String, String)]) -> Result<()>
pub fn get_dead_code_stats(&self) -> Result<(i64, i64)>
pub fn get_edges_by_community(&self, community: i64) -> Result<Vec<Edge>>
pub fn get_file_hashes(&self) -> Result<HashMap<String, String>>
pub fn set_file_hash(&self, path: &str, hash: &str) -> Result<()>
pub fn remove_file_hashes(&self, paths: &[String]) -> Result<()>
pub fn delete_nodes_by_paths(&self, paths: &[String]) -> Result<usize>
pub fn update_node_doc_comment(&self, id: &str, doc: &str) -> Result<()>
pub fn update_node_complexity(&self, id: &str, complexity: f64) -> Result<()>
pub fn get_nodes_by_complexity( &self, limit: usize, min_score: f64, ) -> Result<Vec<Node>>
Sourcepub fn get_docs_coverage(&self) -> Result<DocsCoverage>
pub fn get_docs_coverage(&self) -> Result<DocsCoverage>
Returns (overall_pct, Vec<(community_id, documented, total)>, Vec
pub fn upsert_clones(&self, clones: &[CloneRow]) -> Result<usize>
pub fn get_clones( &self, min_similarity: f64, kind_filter: Option<&str>, ) -> Result<Vec<CloneRow>>
pub fn clear_clones(&self) -> Result<()>
pub fn mark_test_files(&self, paths: &[String]) -> Result<()>
Sourcepub fn update_test_coverage(&self) -> Result<()>
pub fn update_test_coverage(&self) -> Result<()>
After inserting TESTS edges, compute test_count and is_tested for non-test nodes.
Sourcepub fn get_test_coverage_summary(
&self,
top_n: usize,
) -> Result<(f64, i64, i64, Vec<Node>)>
pub fn get_test_coverage_summary( &self, top_n: usize, ) -> Result<(f64, i64, i64, Vec<Node>)>
Returns (overall_pct, tested_count, untested_count, gaps ranked by risk)
pub fn upsert_snapshot(&self, entry: &SnapshotEntry) -> Result<()>
pub fn get_snapshots(&self, limit: usize) -> Result<Vec<SnapshotEntry>>
pub fn get_snapshot_by_sha(&self, sha: &str) -> Result<Option<SnapshotEntry>>
pub fn snapshot_count(&self) -> i64
Auto Trait Implementations§
impl !Freeze for GraphDb
impl !RefUnwindSafe for GraphDb
impl Send for GraphDb
impl !Sync for GraphDb
impl Unpin for GraphDb
impl UnsafeUnpin for GraphDb
impl !UnwindSafe for GraphDb
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
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 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>
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