pub enum Backend {
Sqlite(SqliteStorage),
}Expand description
Storage backend enum (Phase 069-01)
This enum wraps SqliteStorage, KvStorage, or GeometricStorage and delegates StorageTrait methods to the appropriate implementation.
Follows llmgrep’s Backend pattern for consistency across tools.
Variants§
Sqlite(SqliteStorage)
SQLite storage backend (traditional, always available)
Implementations§
Source§impl Backend
impl Backend
Sourcepub fn detect_and_open(db_path: &Path) -> Result<Self>
pub fn detect_and_open(db_path: &Path) -> Result<Self>
Detect backend format from database file and open appropriate backend
Uses file extension and magellan’s detection for consistent backend detection.
§Arguments
db_path- Path to the database file
§Returns
Ok(Backend)- Appropriate backend variantErr(...)- Error if detection or opening fails
§Examples
ⓘ
let backend = Backend::detect_and_open("/path/to/codegraph.db")?;Sourcepub fn is_geometric(&self) -> bool
pub fn is_geometric(&self) -> bool
Check if this is a Geometric backend
Sourcepub fn is_native_v3(&self) -> bool
pub fn is_native_v3(&self) -> bool
Check if this is a Native-V3 backend
Sourcepub fn get_cfg_blocks(&self, function_id: i64) -> Result<Vec<CfgBlockData>>
pub fn get_cfg_blocks(&self, function_id: i64) -> Result<Vec<CfgBlockData>>
Delegate get_cfg_blocks to inner backend
Sourcepub fn get_entity(&self, entity_id: i64) -> Option<GraphEntity>
pub fn get_entity(&self, entity_id: i64) -> Option<GraphEntity>
Delegate get_entity to inner backend
Trait Implementations§
Source§impl StorageTrait for Backend
impl StorageTrait for Backend
Source§fn get_cfg_blocks(&self, function_id: i64) -> Result<Vec<CfgBlockData>>
fn get_cfg_blocks(&self, function_id: i64) -> Result<Vec<CfgBlockData>>
Get CFG blocks for a function Read more
Source§fn get_entity(&self, entity_id: i64) -> Option<GraphEntity>
fn get_entity(&self, entity_id: i64) -> Option<GraphEntity>
Get entity by ID Read more
Auto Trait Implementations§
impl !Freeze for Backend
impl !RefUnwindSafe for Backend
impl Send for Backend
impl !Sync for Backend
impl Unpin for Backend
impl UnsafeUnpin for Backend
impl !UnwindSafe for Backend
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
Mutably borrows from an owned value. Read more
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>
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 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>
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