Skip to main content

mcpr_integrations/store/
mod.rs

1//! SQLite-based request storage engine and query layer for mcpr.
2//!
3//! Every MCP request flowing through the proxy is recorded here, and all
4//! CLI observability commands (`mcpr proxy logs`, `mcpr proxy slow`, etc.)
5//! read from here.
6//!
7//! This is a local event sink — the same pattern as [`crate::emitter`], but
8//! writing to SQLite instead of an external service.
9//!
10//! # Architecture
11//!
12//! ```text
13//! Proxy hot path ──► Store::record() ──► mpsc channel ──► Writer thread ──► SQLite (WAL)
14//!                    (non-blocking)       (10k buffer)     (batch flush)
15//!
16//! CLI commands   ──► QueryEngine ──► read-only SQLite connection
17//! ```
18
19pub mod config;
20pub mod db;
21pub mod duration;
22pub mod engine;
23pub mod event;
24pub mod path;
25pub mod query;
26pub mod schema;
27pub mod sqlite_sink;
28pub mod writer;
29
30// Re-export the main public types for convenience.
31pub use config::FileStoreConfig;
32pub use duration::{parse_duration, since_to_cutoff_ms};
33pub use engine::{Store, StoreConfig, StoreError};
34pub use event::{RequestEvent, RequestStatus, SessionEvent, StoreEvent};
35pub use query::QueryEngine;
36pub use sqlite_sink::SqliteSink;