pub struct StructuralStore { /* private fields */ }Expand description
SQLite-backed structural index store.
Implementations§
Source§impl StructuralStore
impl StructuralStore
Sourcepub fn open(path: &Path) -> SqliteResult<Self>
pub fn open(path: &Path) -> SqliteResult<Self>
Open or create a structural store at the given path.
Sourcepub fn in_memory() -> SqliteResult<Self>
pub fn in_memory() -> SqliteResult<Self>
Create an in-memory store for testing.
Sourcepub fn insert_symbol(&self, symbol: &SymbolRecord) -> Result<i64>
pub fn insert_symbol(&self, symbol: &SymbolRecord) -> Result<i64>
Insert a single symbol and return its ID.
Sourcepub fn insert_symbols_batch(&self, symbols: &[SymbolRecord]) -> Result<Vec<i64>>
pub fn insert_symbols_batch(&self, symbols: &[SymbolRecord]) -> Result<Vec<i64>>
Insert multiple symbols in a transaction for performance.
Sourcepub fn get_symbol_by_id(
&self,
tenant_id: &TenantId,
symbol_id: i64,
) -> Result<Option<SymbolRecord>>
pub fn get_symbol_by_id( &self, tenant_id: &TenantId, symbol_id: i64, ) -> Result<Option<SymbolRecord>>
Look up a single symbol by its stored row id, scoped to a tenant.
Used by QueryRouter::find_callers to resolve the caller side
of a call edge — previous code looked up the callee name, which
returned the wrong symbol when resolving multi-hop callers.
Sourcepub fn find_symbols_by_name(
&self,
tenant_id: &TenantId,
name: &str,
) -> Result<Vec<SymbolRecord>>
pub fn find_symbols_by_name( &self, tenant_id: &TenantId, name: &str, ) -> Result<Vec<SymbolRecord>>
Find symbols by exact name match.
Sourcepub fn find_symbols_by_name_prefix(
&self,
tenant_id: &TenantId,
prefix: &str,
) -> Result<Vec<SymbolRecord>>
pub fn find_symbols_by_name_prefix( &self, tenant_id: &TenantId, prefix: &str, ) -> Result<Vec<SymbolRecord>>
Find symbols by name prefix (for autocomplete).
Sourcepub fn find_symbols_by_file(
&self,
tenant_id: &TenantId,
file_path: &str,
) -> Result<Vec<SymbolRecord>>
pub fn find_symbols_by_file( &self, tenant_id: &TenantId, file_path: &str, ) -> Result<Vec<SymbolRecord>>
Find all symbols in a file.
Sourcepub fn delete_file_symbols(
&self,
tenant_id: &TenantId,
file_path: &str,
) -> Result<usize>
pub fn delete_file_symbols( &self, tenant_id: &TenantId, file_path: &str, ) -> Result<usize>
Delete all symbols for a file (for re-indexing).
Sourcepub fn get_symbol_children(&self, symbol_id: i64) -> Result<Vec<SymbolRecord>>
pub fn get_symbol_children(&self, symbol_id: i64) -> Result<Vec<SymbolRecord>>
Get child symbols of a parent (e.g., methods of a class).
Sourcepub fn insert_call_edge(&self, edge: &CallEdgeRecord) -> SqliteResult<i64>
pub fn insert_call_edge(&self, edge: &CallEdgeRecord) -> SqliteResult<i64>
Insert a single call edge.
Sourcepub fn insert_call_edges_batch(
&self,
edges: &[CallEdgeRecord],
) -> SqliteResult<()>
pub fn insert_call_edges_batch( &self, edges: &[CallEdgeRecord], ) -> SqliteResult<()>
Insert multiple call edges in a batch.
Sourcepub fn find_callers(
&self,
tenant_id: &TenantId,
callee_name: &str,
) -> SqliteResult<Vec<CallEdgeRecord>>
pub fn find_callers( &self, tenant_id: &TenantId, callee_name: &str, ) -> SqliteResult<Vec<CallEdgeRecord>>
Find all callers of a function by name.
Sourcepub fn find_callers_by_symbol(
&self,
callee_symbol_id: i64,
) -> SqliteResult<Vec<CallEdgeRecord>>
pub fn find_callers_by_symbol( &self, callee_symbol_id: i64, ) -> SqliteResult<Vec<CallEdgeRecord>>
Find all callers by resolved symbol ID.
Sourcepub fn find_callees(
&self,
caller_symbol_id: i64,
) -> SqliteResult<Vec<CallEdgeRecord>>
pub fn find_callees( &self, caller_symbol_id: i64, ) -> SqliteResult<Vec<CallEdgeRecord>>
Find all callees of a function by caller symbol ID.
Sourcepub fn delete_file_edges(
&self,
tenant_id: &TenantId,
file_path: &str,
) -> SqliteResult<usize>
pub fn delete_file_edges( &self, tenant_id: &TenantId, file_path: &str, ) -> SqliteResult<usize>
Delete all call edges for a file (for re-indexing).
Sourcepub fn list_unresolved_call_edges(
&self,
tenant_id: &TenantId,
) -> SqliteResult<Vec<CallEdgeRecord>>
pub fn list_unresolved_call_edges( &self, tenant_id: &TenantId, ) -> SqliteResult<Vec<CallEdgeRecord>>
Return every call edge whose callee_symbol_id is still NULL
(cross-file calls that were not resolvable at index time).
QueryRouter::link_callees consumes this list to fill in the
missing ids after a second indexing pass.
Sourcepub fn update_call_edge_callee(
&self,
edge_id: i64,
callee_symbol_id: i64,
) -> SqliteResult<usize>
pub fn update_call_edge_callee( &self, edge_id: i64, callee_symbol_id: i64, ) -> SqliteResult<usize>
Resolve a previously-unlinked call edge by pointing its
callee_symbol_id at a discovered symbol row id. Returns the
number of rows updated (0 or 1).
Sourcepub fn insert_import(&self, import: &ImportRecord) -> SqliteResult<i64>
pub fn insert_import(&self, import: &ImportRecord) -> SqliteResult<i64>
Insert a single import record.
Sourcepub fn insert_imports_batch(&self, imports: &[ImportRecord]) -> SqliteResult<()>
pub fn insert_imports_batch(&self, imports: &[ImportRecord]) -> SqliteResult<()>
Insert multiple import records in a batch.
Sourcepub fn find_imports_by_file(
&self,
tenant_id: &TenantId,
file_path: &str,
) -> SqliteResult<Vec<ImportRecord>>
pub fn find_imports_by_file( &self, tenant_id: &TenantId, file_path: &str, ) -> SqliteResult<Vec<ImportRecord>>
Find all imports in a file.
Sourcepub fn find_importers(
&self,
tenant_id: &TenantId,
module: &str,
) -> SqliteResult<Vec<ImportRecord>>
pub fn find_importers( &self, tenant_id: &TenantId, module: &str, ) -> SqliteResult<Vec<ImportRecord>>
Find all files that import a module.
Sourcepub fn delete_file_imports(
&self,
tenant_id: &TenantId,
file_path: &str,
) -> SqliteResult<usize>
pub fn delete_file_imports( &self, tenant_id: &TenantId, file_path: &str, ) -> SqliteResult<usize>
Delete all imports for a file (for re-indexing).
Sourcepub fn insert_tool_trace(&self, trace: &ToolTraceRecord) -> SqliteResult<i64>
pub fn insert_tool_trace(&self, trace: &ToolTraceRecord) -> SqliteResult<i64>
Insert a tool trace record.
Returns the assigned trace_id.
Sourcepub fn insert_tool_traces_batch(
&self,
traces: &[ToolTraceRecord],
) -> SqliteResult<()>
pub fn insert_tool_traces_batch( &self, traces: &[ToolTraceRecord], ) -> SqliteResult<()>
Insert multiple tool traces in a batch.
Sourcepub fn find_tool_traces(
&self,
tenant_id: &TenantId,
tool_name: Option<&str>,
time_range: Option<TimeRange>,
) -> SqliteResult<Vec<ToolTraceRecord>>
pub fn find_tool_traces( &self, tenant_id: &TenantId, tool_name: Option<&str>, time_range: Option<TimeRange>, ) -> SqliteResult<Vec<ToolTraceRecord>>
Find tool traces by tenant, optionally filtered by tool name and time range.
Sourcepub fn find_tool_traces_by_session(
&self,
tenant_id: &TenantId,
session_id: &str,
) -> SqliteResult<Vec<ToolTraceRecord>>
pub fn find_tool_traces_by_session( &self, tenant_id: &TenantId, session_id: &str, ) -> SqliteResult<Vec<ToolTraceRecord>>
Find tool traces by session ID.
Sourcepub fn find_tool_traces_with_error(
&self,
tenant_id: &TenantId,
) -> SqliteResult<Vec<ToolTraceRecord>>
pub fn find_tool_traces_with_error( &self, tenant_id: &TenantId, ) -> SqliteResult<Vec<ToolTraceRecord>>
Find tool traces that have errors.
Sourcepub fn insert_stack_trace(
&self,
trace: &StackTraceRecord,
frames: &[StackFrameRecord],
) -> SqliteResult<i64>
pub fn insert_stack_trace( &self, trace: &StackTraceRecord, frames: &[StackFrameRecord], ) -> SqliteResult<i64>
Insert a stack trace with its frames.
Inserts both the trace and all frames in a single transaction. Returns the assigned trace_id.
Sourcepub fn find_stack_traces(
&self,
tenant_id: &TenantId,
error_signature: Option<&str>,
time_range: Option<TimeRange>,
) -> SqliteResult<Vec<StackTraceRecord>>
pub fn find_stack_traces( &self, tenant_id: &TenantId, error_signature: Option<&str>, time_range: Option<TimeRange>, ) -> SqliteResult<Vec<StackTraceRecord>>
Find stack traces by tenant, optionally filtered by error signature and time range.
Sourcepub fn find_stack_traces_by_function(
&self,
tenant_id: &TenantId,
function_name: &str,
) -> SqliteResult<Vec<StackTraceRecord>>
pub fn find_stack_traces_by_function( &self, tenant_id: &TenantId, function_name: &str, ) -> SqliteResult<Vec<StackTraceRecord>>
Find stack traces where a specific function appears in the stack.
Sourcepub fn get_stack_frames(
&self,
trace_id: i64,
) -> SqliteResult<Vec<StackFrameRecord>>
pub fn get_stack_frames( &self, trace_id: i64, ) -> SqliteResult<Vec<StackFrameRecord>>
Get all frames for a stack trace.
Auto Trait Implementations§
impl !Freeze for StructuralStore
impl RefUnwindSafe for StructuralStore
impl Send for StructuralStore
impl Sync for StructuralStore
impl Unpin for StructuralStore
impl UnsafeUnpin for StructuralStore
impl UnwindSafe for StructuralStore
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
impl<T> ErasedDestructor for Twhere
T: 'static,
impl<T> Fruit for T
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>
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 more