Skip to main content

SqliteGraphStore

Struct SqliteGraphStore 

Source
pub struct SqliteGraphStore { /* private fields */ }
Expand description

A [GraphStore] backed by a SQLite database.

Implementations§

Source§

impl SqliteGraphStore

Source

pub fn open(path: impl AsRef<Path>) -> Result<Self>

Open (creating if absent, including parent directories) a file-backed store at path.

Source

pub fn open_in_memory() -> Result<Self>

Open an ephemeral in-memory store.

Source

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

Source§

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>

Symbols defined in the slice at path.
Source§

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>>

References whose target name is name, each with its path.
Source§

fn callers_of(&self, name: &str) -> Vec<String>

Distinct enclosing-function names that reference name.
Source§

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>>

Every symbol in the view, each with its path (used for whole-graph operations like diffing).
Source§

fn all_references(&self) -> Vec<Located<Reference>>

Every reference in the view, each with its path.
§

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

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 top(&self, ranking: Ranking, limit: usize) -> Page<RankedSymbol>

The top limit symbol names by ranking, descending. Read more
§

fn list(&self, filter: &SymbolFilter, limit: usize) -> Page<Located<Symbol>>

Symbols matching filter, in path order, bounded by limit. Read more
§

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§

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, 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.
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,