pub struct UnifiedGraphStore {
pub codebase_path: PathBuf,
pub db_path: PathBuf,
pub backend_kind: BackendKind,
/* private fields */
}Expand description
Unified graph store supporting dual backends.
This provides graph storage for symbols and references with the user’s choice of SQLite or Native V3 backend. Both backends expose the same functionality through a unified API.
Fields§
§codebase_path: PathBufPath to codebase
db_path: PathBufPath to database file
backend_kind: BackendKindActive backend kind
Implementations§
Source§impl UnifiedGraphStore
impl UnifiedGraphStore
Sourcepub async fn open(
codebase_path: impl AsRef<Path>,
backend_kind: BackendKind,
) -> Result<Self>
pub async fn open( codebase_path: impl AsRef<Path>, backend_kind: BackendKind, ) -> Result<Self>
Sourcepub async fn open_with_path(
codebase_path: impl AsRef<Path>,
db_path: impl AsRef<Path>,
backend_kind: BackendKind,
) -> Result<Self>
pub async fn open_with_path( codebase_path: impl AsRef<Path>, db_path: impl AsRef<Path>, backend_kind: BackendKind, ) -> Result<Self>
Opens a graph store with a custom database path.
§Arguments
codebase_path- Path to codebase directorydb_path- Custom path for database filebackend_kind- Which backend to use
Sourcepub fn backend_kind(&self) -> BackendKind
pub fn backend_kind(&self) -> BackendKind
Returns the backend kind currently in use.
Sourcepub fn is_connected(&self) -> bool
pub fn is_connected(&self) -> bool
Returns true if the database file exists.
Sourcepub async fn insert_symbol(&self, _symbol: &Symbol) -> Result<SymbolId>
pub async fn insert_symbol(&self, _symbol: &Symbol) -> Result<SymbolId>
Sourcepub async fn insert_reference(&self, reference: &Reference) -> Result<()>
pub async fn insert_reference(&self, reference: &Reference) -> Result<()>
Sourcepub async fn get_symbol(&self, _id: SymbolId) -> Result<Symbol>
pub async fn get_symbol(&self, _id: SymbolId) -> Result<Symbol>
Sourcepub async fn symbol_exists(&self, _id: SymbolId) -> Result<bool>
pub async fn symbol_exists(&self, _id: SymbolId) -> Result<bool>
Sourcepub async fn get_all_symbols(&self) -> Result<Vec<Symbol>>
pub async fn get_all_symbols(&self) -> Result<Vec<Symbol>>
Get all symbols in the graph.
Sourcepub async fn symbol_count(&self) -> Result<usize>
pub async fn symbol_count(&self) -> Result<usize>
Get count of symbols in the graph.
Sourcepub async fn index_cross_file_references(&self) -> Result<usize>
pub async fn index_cross_file_references(&self) -> Result<usize>
Scans and indexes cross-file references for Native V3 backend.
This is a capability that Native V3 enables over SQLite. It uses magellan’s native cross-file reference indexing.
Note: With the updated magellan, cross-file references are automatically
indexed during the normal index_references call. This method is kept
for API compatibility but delegates to magellan.
Trait Implementations§
Source§impl Clone for UnifiedGraphStore
impl Clone for UnifiedGraphStore
Auto Trait Implementations§
impl !Freeze for UnifiedGraphStore
impl RefUnwindSafe for UnifiedGraphStore
impl Send for UnifiedGraphStore
impl Sync for UnifiedGraphStore
impl Unpin for UnifiedGraphStore
impl UnsafeUnpin for UnifiedGraphStore
impl UnwindSafe for UnifiedGraphStore
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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