Skip to main content

StructuralStore

Struct StructuralStore 

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

SQLite-backed structural index store.

Implementations§

Source§

impl StructuralStore

Source

pub fn open(path: &Path) -> SqliteResult<Self>

Open or create a structural store at the given path.

Source

pub fn in_memory() -> SqliteResult<Self>

Create an in-memory store for testing.

Source

pub fn insert_symbol(&self, symbol: &SymbolRecord) -> Result<i64>

Insert a single symbol and return its ID.

Source

pub fn insert_symbols_batch(&self, symbols: &[SymbolRecord]) -> Result<Vec<i64>>

Insert multiple symbols in a transaction for performance.

Source

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.

Source

pub fn find_symbols_by_name( &self, tenant_id: &TenantId, name: &str, ) -> Result<Vec<SymbolRecord>>

Find symbols by exact name match.

Source

pub fn find_symbols_by_name_prefix( &self, tenant_id: &TenantId, prefix: &str, ) -> Result<Vec<SymbolRecord>>

Find symbols by name prefix (for autocomplete).

Source

pub fn find_symbols_by_file( &self, tenant_id: &TenantId, file_path: &str, ) -> Result<Vec<SymbolRecord>>

Find all symbols in a file.

Source

pub fn delete_file_symbols( &self, tenant_id: &TenantId, file_path: &str, ) -> Result<usize>

Delete all symbols for a file (for re-indexing).

Source

pub fn get_symbol_children(&self, symbol_id: i64) -> Result<Vec<SymbolRecord>>

Get child symbols of a parent (e.g., methods of a class).

Source

pub fn insert_call_edge(&self, edge: &CallEdgeRecord) -> SqliteResult<i64>

Insert a single call edge.

Source

pub fn insert_call_edges_batch( &self, edges: &[CallEdgeRecord], ) -> SqliteResult<()>

Insert multiple call edges in a batch.

Source

pub fn find_callers( &self, tenant_id: &TenantId, callee_name: &str, ) -> SqliteResult<Vec<CallEdgeRecord>>

Find all callers of a function by name.

Source

pub fn find_callers_by_symbol( &self, callee_symbol_id: i64, ) -> SqliteResult<Vec<CallEdgeRecord>>

Find all callers by resolved symbol ID.

Source

pub fn find_callees( &self, caller_symbol_id: i64, ) -> SqliteResult<Vec<CallEdgeRecord>>

Find all callees of a function by caller symbol ID.

Source

pub fn delete_file_edges( &self, tenant_id: &TenantId, file_path: &str, ) -> SqliteResult<usize>

Delete all call edges for a file (for re-indexing).

Source

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.

Source

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

Source

pub fn insert_import(&self, import: &ImportRecord) -> SqliteResult<i64>

Insert a single import record.

Source

pub fn insert_imports_batch(&self, imports: &[ImportRecord]) -> SqliteResult<()>

Insert multiple import records in a batch.

Source

pub fn find_imports_by_file( &self, tenant_id: &TenantId, file_path: &str, ) -> SqliteResult<Vec<ImportRecord>>

Find all imports in a file.

Source

pub fn find_importers( &self, tenant_id: &TenantId, module: &str, ) -> SqliteResult<Vec<ImportRecord>>

Find all files that import a module.

Source

pub fn delete_file_imports( &self, tenant_id: &TenantId, file_path: &str, ) -> SqliteResult<usize>

Delete all imports for a file (for re-indexing).

Source

pub fn insert_tool_trace(&self, trace: &ToolTraceRecord) -> SqliteResult<i64>

Insert a tool trace record.

Returns the assigned trace_id.

Source

pub fn insert_tool_traces_batch( &self, traces: &[ToolTraceRecord], ) -> SqliteResult<()>

Insert multiple tool traces in a batch.

Source

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.

Source

pub fn find_tool_traces_by_session( &self, tenant_id: &TenantId, session_id: &str, ) -> SqliteResult<Vec<ToolTraceRecord>>

Find tool traces by session ID.

Source

pub fn find_tool_traces_with_error( &self, tenant_id: &TenantId, ) -> SqliteResult<Vec<ToolTraceRecord>>

Find tool traces that have errors.

Source

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.

Source

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.

Source

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.

Source

pub fn get_stack_frames( &self, trace_id: i64, ) -> SqliteResult<Vec<StackFrameRecord>>

Get all frames for a stack trace.

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> Downcast for T
where T: Any,

Source§

fn into_any(self: Box<T>) -> Box<dyn Any>

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

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

Converts &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)

Converts &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
where T: Any + Send,

Source§

fn into_any_send(self: Box<T>) -> Box<dyn Any + Send>

Converts Box<Trait> (where Trait: DowncastSend) to Box<dyn Any + Send>, which can then be downcast into Box<ConcreteType> where ConcreteType implements Trait.
Source§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

Source§

fn into_any_sync(self: Box<T>) -> Box<dyn Any + Send + Sync>

Converts Box<Trait> (where Trait: DowncastSync) to Box<dyn Any + Send + Sync>, which can then be downcast into Box<ConcreteType> where ConcreteType implements Trait.
Source§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync> ⓘ

Converts Arc<Trait> (where Trait: DowncastSync) to Arc<Any>, which can then be downcast into Arc<ConcreteType> where ConcreteType implements Trait.
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Fruit for T
where T: Send + Downcast,

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more