pub struct GraphStore { /* private fields */ }Expand description
Persistent graph store backed by Kuzu.
Implementations§
Source§impl GraphStore
impl GraphStore
Sourcepub fn write_lock(&self) -> Result<WriteLock>
pub fn write_lock(&self) -> Result<WriteLock>
Acquire exclusive write lock. Blocks until available.
Sourcepub fn try_write_lock(&self) -> Result<Option<WriteLock>>
pub fn try_write_lock(&self) -> Result<Option<WriteLock>>
Try to acquire write lock without blocking. Returns None if already held.
pub fn connection(&self) -> Result<Connection<'_>>
Sourcepub fn remove_file(&self, file: &str) -> Result<()>
pub fn remove_file(&self, file: &str) -> Result<()>
Remove all graph data for a deleted file.
Sourcepub fn remove_file_conn(&self, conn: &Connection<'_>, file: &str) -> Result<()>
pub fn remove_file_conn(&self, conn: &Connection<'_>, file: &str) -> Result<()>
Caller must hold WriteLock.
Sourcepub fn get_file_hashes(&self) -> Result<HashMap<String, String>>
pub fn get_file_hashes(&self) -> Result<HashMap<String, String>>
Return map of file path -> content_hash for all indexed modules. Used by incremental indexing to skip unchanged files.
Sourcepub fn get_all_symbols(&self) -> Result<Vec<(String, String, String, String)>>
pub fn get_all_symbols(&self) -> Result<Vec<(String, String, String, String)>>
Return all symbols as (name, id, file, kind) tuples – used by resolve_calls.
Sourcepub fn derive_tested_by_edges(&self) -> Result<usize>
pub fn derive_tested_by_edges(&self) -> Result<usize>
Get total counts for stats.
pub fn stats(&self) -> Result<GraphStats>
Source§impl GraphStore
impl GraphStore
Sourcepub fn test_parquet_quality(&self) -> Result<()>
pub fn test_parquet_quality(&self) -> Result<()>
Test: DELETE + COPY FROM parquet produces identical data to MERGE/UNWIND. Covers edge cases: <>, quotes, unicode, empty strings, backslashes, newlines.
Sourcepub fn benchmark_bulk_write(&self, n: usize) -> Result<()>
pub fn benchmark_bulk_write(&self, n: usize) -> Result<()>
Benchmark: compare COPY FROM CSV vs UNWIND for bulk symbol inserts. Creates isolated test tables, measures both approaches, prints results.
Sourcepub fn benchmark_parquet_vs_csv(&self) -> Result<()>
pub fn benchmark_parquet_vs_csv(&self) -> Result<()>
Benchmark: CSV vs Parquet vs UNWIND – apple-to-apple with real symbol data. Tests performance AND data integrity (docstrings with <, >, quotes, unicode).
Source§impl GraphStore
impl GraphStore
Sourcepub fn upsert_all_bulk(
&self,
conn: &Connection<'_>,
extractions: &[FileExtraction],
) -> Result<()>
pub fn upsert_all_bulk( &self, conn: &Connection<'_>, extractions: &[FileExtraction], ) -> Result<()>
Bulk insert all extractions in minimal queries – one UNWIND per node/edge type. Much faster than calling upsert_file_conn_no_delete per file. Caller must hold WriteLock.
Source§impl GraphStore
impl GraphStore
Sourcepub fn upsert_folders_bulk(&self, file_paths: &[&str]) -> Result<()>
pub fn upsert_folders_bulk(&self, file_paths: &[&str]) -> Result<()>
Create Folder nodes and edges for a set of file paths in bulk. More efficient than per-file upsert_folder_hierarchy calls.
Sourcepub fn upsert_folders_bulk_conn(
&self,
conn: &Connection<'_>,
file_paths: &[&str],
) -> Result<()>
pub fn upsert_folders_bulk_conn( &self, conn: &Connection<'_>, file_paths: &[&str], ) -> Result<()>
Caller must hold WriteLock.
Sourcepub fn upsert_all_parquet(&self, extractions: &[FileExtraction]) -> Result<()>
pub fn upsert_all_parquet(&self, extractions: &[FileExtraction]) -> Result<()>
Bulk write all extractions using COPY FROM Parquet – binary format eliminates escaping issues. Used for –full index. Incremental index still uses upsert_file_conn_no_delete.
Sourcepub fn upsert_all_parquet_conn(
&self,
conn: &Connection<'_>,
extractions: &[FileExtraction],
) -> Result<()>
pub fn upsert_all_parquet_conn( &self, conn: &Connection<'_>, extractions: &[FileExtraction], ) -> Result<()>
Caller must hold WriteLock.
Source§impl GraphStore
impl GraphStore
Sourcepub fn upsert_file(&self, extraction: &FileExtraction) -> Result<()>
pub fn upsert_file(&self, extraction: &FileExtraction) -> Result<()>
Insert a file extraction into the graph. Removes old data for the file first (incremental update).
Sourcepub fn upsert_file_conn(
&self,
conn: &Connection<'_>,
extraction: &FileExtraction,
) -> Result<()>
pub fn upsert_file_conn( &self, conn: &Connection<'_>, extraction: &FileExtraction, ) -> Result<()>
Caller must hold WriteLock.
Sourcepub fn upsert_file_conn_no_delete(
&self,
conn: &Connection<'_>,
extraction: &FileExtraction,
) -> Result<()>
pub fn upsert_file_conn_no_delete( &self, conn: &Connection<'_>, extraction: &FileExtraction, ) -> Result<()>
Caller must hold WriteLock.
Auto Trait Implementations§
impl !Freeze for GraphStore
impl !RefUnwindSafe for GraphStore
impl Send for GraphStore
impl Sync for GraphStore
impl Unpin for GraphStore
impl UnsafeUnpin for GraphStore
impl UnwindSafe for GraphStore
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
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>
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>
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 moreSource§impl<D> OwoColorize for D
impl<D> OwoColorize for D
Source§fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
Source§fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
Source§fn black<'a>(&'a self) -> FgColorDisplay<'a, Black, Self>
fn black<'a>(&'a self) -> FgColorDisplay<'a, Black, Self>
Source§fn on_black<'a>(&'a self) -> BgColorDisplay<'a, Black, Self>
fn on_black<'a>(&'a self) -> BgColorDisplay<'a, Black, Self>
Source§fn red<'a>(&'a self) -> FgColorDisplay<'a, Red, Self>
fn red<'a>(&'a self) -> FgColorDisplay<'a, Red, Self>
Source§fn on_red<'a>(&'a self) -> BgColorDisplay<'a, Red, Self>
fn on_red<'a>(&'a self) -> BgColorDisplay<'a, Red, Self>
Source§fn green<'a>(&'a self) -> FgColorDisplay<'a, Green, Self>
fn green<'a>(&'a self) -> FgColorDisplay<'a, Green, Self>
Source§fn on_green<'a>(&'a self) -> BgColorDisplay<'a, Green, Self>
fn on_green<'a>(&'a self) -> BgColorDisplay<'a, Green, Self>
Source§fn yellow<'a>(&'a self) -> FgColorDisplay<'a, Yellow, Self>
fn yellow<'a>(&'a self) -> FgColorDisplay<'a, Yellow, Self>
Source§fn on_yellow<'a>(&'a self) -> BgColorDisplay<'a, Yellow, Self>
fn on_yellow<'a>(&'a self) -> BgColorDisplay<'a, Yellow, Self>
Source§fn blue<'a>(&'a self) -> FgColorDisplay<'a, Blue, Self>
fn blue<'a>(&'a self) -> FgColorDisplay<'a, Blue, Self>
Source§fn on_blue<'a>(&'a self) -> BgColorDisplay<'a, Blue, Self>
fn on_blue<'a>(&'a self) -> BgColorDisplay<'a, Blue, Self>
Source§fn magenta<'a>(&'a self) -> FgColorDisplay<'a, Magenta, Self>
fn magenta<'a>(&'a self) -> FgColorDisplay<'a, Magenta, Self>
Source§fn on_magenta<'a>(&'a self) -> BgColorDisplay<'a, Magenta, Self>
fn on_magenta<'a>(&'a self) -> BgColorDisplay<'a, Magenta, Self>
Source§fn purple<'a>(&'a self) -> FgColorDisplay<'a, Magenta, Self>
fn purple<'a>(&'a self) -> FgColorDisplay<'a, Magenta, Self>
Source§fn on_purple<'a>(&'a self) -> BgColorDisplay<'a, Magenta, Self>
fn on_purple<'a>(&'a self) -> BgColorDisplay<'a, Magenta, Self>
Source§fn cyan<'a>(&'a self) -> FgColorDisplay<'a, Cyan, Self>
fn cyan<'a>(&'a self) -> FgColorDisplay<'a, Cyan, Self>
Source§fn on_cyan<'a>(&'a self) -> BgColorDisplay<'a, Cyan, Self>
fn on_cyan<'a>(&'a self) -> BgColorDisplay<'a, Cyan, Self>
Source§fn white<'a>(&'a self) -> FgColorDisplay<'a, White, Self>
fn white<'a>(&'a self) -> FgColorDisplay<'a, White, Self>
Source§fn on_white<'a>(&'a self) -> BgColorDisplay<'a, White, Self>
fn on_white<'a>(&'a self) -> BgColorDisplay<'a, White, Self>
Source§fn default_color<'a>(&'a self) -> FgColorDisplay<'a, Default, Self>
fn default_color<'a>(&'a self) -> FgColorDisplay<'a, Default, Self>
Source§fn on_default_color<'a>(&'a self) -> BgColorDisplay<'a, Default, Self>
fn on_default_color<'a>(&'a self) -> BgColorDisplay<'a, Default, Self>
Source§fn bright_black<'a>(&'a self) -> FgColorDisplay<'a, BrightBlack, Self>
fn bright_black<'a>(&'a self) -> FgColorDisplay<'a, BrightBlack, Self>
Source§fn on_bright_black<'a>(&'a self) -> BgColorDisplay<'a, BrightBlack, Self>
fn on_bright_black<'a>(&'a self) -> BgColorDisplay<'a, BrightBlack, Self>
Source§fn bright_red<'a>(&'a self) -> FgColorDisplay<'a, BrightRed, Self>
fn bright_red<'a>(&'a self) -> FgColorDisplay<'a, BrightRed, Self>
Source§fn on_bright_red<'a>(&'a self) -> BgColorDisplay<'a, BrightRed, Self>
fn on_bright_red<'a>(&'a self) -> BgColorDisplay<'a, BrightRed, Self>
Source§fn bright_green<'a>(&'a self) -> FgColorDisplay<'a, BrightGreen, Self>
fn bright_green<'a>(&'a self) -> FgColorDisplay<'a, BrightGreen, Self>
Source§fn on_bright_green<'a>(&'a self) -> BgColorDisplay<'a, BrightGreen, Self>
fn on_bright_green<'a>(&'a self) -> BgColorDisplay<'a, BrightGreen, Self>
Source§fn bright_yellow<'a>(&'a self) -> FgColorDisplay<'a, BrightYellow, Self>
fn bright_yellow<'a>(&'a self) -> FgColorDisplay<'a, BrightYellow, Self>
Source§fn on_bright_yellow<'a>(&'a self) -> BgColorDisplay<'a, BrightYellow, Self>
fn on_bright_yellow<'a>(&'a self) -> BgColorDisplay<'a, BrightYellow, Self>
Source§fn bright_blue<'a>(&'a self) -> FgColorDisplay<'a, BrightBlue, Self>
fn bright_blue<'a>(&'a self) -> FgColorDisplay<'a, BrightBlue, Self>
Source§fn on_bright_blue<'a>(&'a self) -> BgColorDisplay<'a, BrightBlue, Self>
fn on_bright_blue<'a>(&'a self) -> BgColorDisplay<'a, BrightBlue, Self>
Source§fn bright_magenta<'a>(&'a self) -> FgColorDisplay<'a, BrightMagenta, Self>
fn bright_magenta<'a>(&'a self) -> FgColorDisplay<'a, BrightMagenta, Self>
Source§fn on_bright_magenta<'a>(&'a self) -> BgColorDisplay<'a, BrightMagenta, Self>
fn on_bright_magenta<'a>(&'a self) -> BgColorDisplay<'a, BrightMagenta, Self>
Source§fn bright_purple<'a>(&'a self) -> FgColorDisplay<'a, BrightMagenta, Self>
fn bright_purple<'a>(&'a self) -> FgColorDisplay<'a, BrightMagenta, Self>
Source§fn on_bright_purple<'a>(&'a self) -> BgColorDisplay<'a, BrightMagenta, Self>
fn on_bright_purple<'a>(&'a self) -> BgColorDisplay<'a, BrightMagenta, Self>
Source§fn bright_cyan<'a>(&'a self) -> FgColorDisplay<'a, BrightCyan, Self>
fn bright_cyan<'a>(&'a self) -> FgColorDisplay<'a, BrightCyan, Self>
Source§fn on_bright_cyan<'a>(&'a self) -> BgColorDisplay<'a, BrightCyan, Self>
fn on_bright_cyan<'a>(&'a self) -> BgColorDisplay<'a, BrightCyan, Self>
Source§fn bright_white<'a>(&'a self) -> FgColorDisplay<'a, BrightWhite, Self>
fn bright_white<'a>(&'a self) -> FgColorDisplay<'a, BrightWhite, Self>
Source§fn on_bright_white<'a>(&'a self) -> BgColorDisplay<'a, BrightWhite, Self>
fn on_bright_white<'a>(&'a self) -> BgColorDisplay<'a, BrightWhite, Self>
Source§fn bold<'a>(&'a self) -> BoldDisplay<'a, Self>
fn bold<'a>(&'a self) -> BoldDisplay<'a, Self>
Source§fn dimmed<'a>(&'a self) -> DimDisplay<'a, Self>
fn dimmed<'a>(&'a self) -> DimDisplay<'a, Self>
Source§fn italic<'a>(&'a self) -> ItalicDisplay<'a, Self>
fn italic<'a>(&'a self) -> ItalicDisplay<'a, Self>
Source§fn underline<'a>(&'a self) -> UnderlineDisplay<'a, Self>
fn underline<'a>(&'a self) -> UnderlineDisplay<'a, Self>
Source§fn blink<'a>(&'a self) -> BlinkDisplay<'a, Self>
fn blink<'a>(&'a self) -> BlinkDisplay<'a, Self>
Source§fn blink_fast<'a>(&'a self) -> BlinkFastDisplay<'a, Self>
fn blink_fast<'a>(&'a self) -> BlinkFastDisplay<'a, Self>
Source§fn reversed<'a>(&'a self) -> ReversedDisplay<'a, Self>
fn reversed<'a>(&'a self) -> ReversedDisplay<'a, Self>
Source§fn strikethrough<'a>(&'a self) -> StrikeThroughDisplay<'a, Self>
fn strikethrough<'a>(&'a self) -> StrikeThroughDisplay<'a, Self>
Source§fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::fg or
a color-specific method, such as OwoColorize::green, Read moreSource§fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::bg or
a color-specific method, such as OwoColorize::on_yellow, Read more