Skip to main content

mirage/
lib.rs

1//! Mirage - Path-Aware Code Intelligence Engine
2//!
3//! A control-flow and logic graph engine for multi-language codebases.
4//!
5//! # Getting Started
6//!
7//! ```rust,no_run
8//! use mirage_analyzer::Backend;
9//! use std::path::Path;
10//!
11//! // Auto-detect and open the database backend
12//! let backend = Backend::detect_and_open(Path::new("codegraph.db"))?;
13//!
14//! // Query CFG blocks
15//! let blocks = backend.get_cfg_blocks(123)?;
16//! # Ok::<(), anyhow::Error>(())
17//! ```
18//!
19//! # Backend Support
20//!
21//! Mirage supports SQLite storage with optional geometric analysis:
22//! - **SQLite**: Default backend, backward compatible with Magellan v7+
23//!
24//! The backend is automatically detected from the database file format.
25//!
26//! # Public API
27//!
28//! - [`Backend`] - Enum wrapping storage backends with auto-detection
29//! - [`StorageTrait`] - Backend-agnostic storage interface
30//! - [`MirageDb`] - Legacy database connection (wraps Backend internally)
31
32#![allow(dead_code)]
33
34pub mod analysis;
35pub mod cfg;
36pub mod cli;
37pub mod integrations;
38pub mod mir;
39pub mod output;
40pub mod platform;
41pub mod router;
42pub mod storage;
43
44// Public API exports
45pub use storage::{create_schema, Backend, CfgBlockData, DatabaseStatus, MirageDb, StorageTrait};