pub struct SqliteGraphStore { /* private fields */ }Expand description
A [GraphStore] backed by a SQLite database.
Implementations§
Source§impl SqliteGraphStore
impl SqliteGraphStore
Sourcepub fn open(path: impl AsRef<Path>) -> Result<Self>
pub fn open(path: impl AsRef<Path>) -> Result<Self>
Open (creating if absent, including parent directories) a file-backed
store at path.
Sourcepub fn open_in_memory() -> Result<Self>
pub fn open_in_memory() -> Result<Self>
Open an ephemeral in-memory store.
Sourcepub fn remove_path(&mut self, path: &str)
pub fn remove_path(&mut self, path: &str)
Remove all rows for path (a file dropped from the view). Complements
[GraphStore::insert], which replaces a path’s rows.
Trait Implementations§
Source§impl GraphStore for SqliteGraphStore
impl GraphStore for SqliteGraphStore
Source§fn insert(&mut self, path: &str, graph: CodeGraph)
fn insert(&mut self, path: &str, graph: CodeGraph)
Insert (or replace) the slice assembled at
path. Re-inserting the same
path overwrites — slices are content-addressed and write-if-absent, never
appended, so this cannot duplicate a file’s symbols.Source§fn symbols_in_file(&self, path: &str) -> Vec<Symbol>
fn symbols_in_file(&self, path: &str) -> Vec<Symbol>
Symbols defined in the slice at
path.Source§fn definitions(&self, name: &str) -> Vec<Located<Symbol>>
fn definitions(&self, name: &str) -> Vec<Located<Symbol>>
Definitions matching
name, each with the path it was found under (there
may be several — names are unresolved).Source§fn references_to(&self, name: &str) -> Vec<Located<Reference>>
fn references_to(&self, name: &str) -> Vec<Located<Reference>>
References whose target name is
name, each with its path.Source§fn callers_of(&self, name: &str) -> Vec<String>
fn callers_of(&self, name: &str) -> Vec<String>
Distinct enclosing-function names that reference
name.Source§fn callees(&self, name: &str) -> Vec<String>
fn callees(&self, name: &str) -> Vec<String>
Distinct names referenced from within
name (the inverse of
callers_of), sorted.Source§fn all_symbols(&self) -> Vec<Located<Symbol>>
fn all_symbols(&self) -> Vec<Located<Symbol>>
Every symbol in the view, each with its path (used for whole-graph
operations like diffing).
Source§fn all_references(&self) -> Vec<Located<Reference>>
fn all_references(&self) -> Vec<Located<Reference>>
Every reference in the view, each with its path.
§fn impact(&self, name: &str) -> Vec<String>
fn impact(&self, name: &str) -> Vec<String>
The transitive closure of callers: every symbol that could be affected if
name changes, reached by walking callers_of
breadth-first. Runs server-side (never ships the whole graph); the seed
name is excluded, and cycles terminate via a visited set. Returned
sorted.§fn overview(&self, largest: usize) -> ViewOverview
fn overview(&self, largest: usize) -> ViewOverview
The aggregate shape of the whole view: counts, a breakdown by kind and
by language, and the
largest files by symbol count. Read more§fn unreferenced(
&self,
filter: &SymbolFilter,
exclude_tests: bool,
limit: usize,
) -> Page<Located<Symbol>>
fn unreferenced( &self, filter: &SymbolFilter, exclude_tests: bool, limit: usize, ) -> Page<Located<Symbol>>
Symbols with no inbound reference anywhere in the view — dead-code
candidates, in path then line order. Read more
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