g8_store/lib.rs
1//! `g8-store` — embedded SQLite persistence layer for the G8.
2//!
3//! Provides the [`StoreConnection`] trait and its rusqlite-backed implementation
4//! [`RusqliteStore`]. All schema migrations are embedded in the binary via
5//! `refinery`.
6//!
7//! # Opening a store
8//!
9//! ```no_run
10//! use g8_store::RusqliteStore;
11//! use std::path::Path;
12//!
13//! let mut store = RusqliteStore::open(Path::new(".g8/store.db")).unwrap();
14//! store.migrate().unwrap();
15//! ```
16//!
17//! # In-memory store (tests)
18//!
19//! ```
20//! use g8_store::RusqliteStore;
21//!
22//! let mut store = RusqliteStore::open_in_memory().unwrap();
23//! store.migrate().unwrap();
24//! ```
25
26pub mod migrations;
27mod store_impl;
28
29pub use store_impl::{
30 ApplyScanReport, PairingError, PairingErrorReason, PlanFilter, RawIntentCheckPayload,
31 RusqliteStore, ScanResult, StalePlanCandidate, StoreConnection, StoreError, WatchHandle,
32};
33
34// Re-export OverlapKind + PlanIntentRelation from g8-core so callers don't
35// need to import g8-core just to call link_plan_capability / link_plan_intent.
36pub use g8_core::plan::{OverlapKind, PlanIntentRelation};