Skip to main content

lora_database/
lib.rs

1//! In-memory Lora database — the database-facing orchestration layer.
2//!
3//! `lora-database` owns the parse → analyze → compile → execute pipeline
4//! and exposes a single [`Database`] entry point that transports (HTTP,
5//! benches, examples, embedded callers) can drive without knowing about the
6//! underlying crates.
7//!
8//! # Quick start
9//!
10//! ```no_run
11//! use lora_database::Database;
12//!
13//! let db = Database::in_memory();
14//! db.execute("CREATE (:User {name: 'alice'})", None).unwrap();
15//! ```
16
17mod database;
18mod durable_io;
19mod error;
20mod explain;
21mod live_store;
22mod named;
23mod plan_cache;
24mod snapshot;
25mod stream;
26mod transaction;
27mod wal;
28
29pub use database::{Database, GraphDirection, QueryRunner};
30pub use error::{LoraError, LoraErrorCategory, LoraErrorCode};
31pub use explain::{OperatorMetrics, PlanShape, ProfileMetrics, QueryPlan, QueryProfile};
32pub use lora_compiler::{PlanTree, PlanTreeNode};
33pub use named::{
34    resolve_database_path, DatabaseName, DatabaseNameError, DatabaseOpenOptions,
35    DEFAULT_DATABASE_MAX_BYTES,
36};
37pub use snapshot::{
38    snapshot_credentials_from_json, snapshot_options_from_json, SnapshotAdmin, SnapshotByteFormat,
39    SnapshotConfig,
40};
41pub use stream::QueryStream;
42pub use transaction::{Transaction, TransactionError, TransactionMode};
43pub use wal::{WalAdmin, WalStatus};
44
45// Re-export the WAL configuration types so transports / operators can
46// build a `Database::open_with_wal` argument without taking a direct
47// `lora-wal` dependency.
48pub use lora_wal::{SyncMode, WalConfig};
49
50// Re-export the core execution types so callers don't need a direct
51// dependency on `lora-executor`.
52pub use lora_executor::{ExecuteOptions, LoraValue, QueryResult, ResultFormat, Row};
53
54// Re-export the default in-memory backing store so callers only need to
55// depend on `lora-database` for the happy path.
56pub use lora_store::InMemoryGraph;
57
58// Snapshot surface — re-exported so bindings/servers don't need a direct
59// `lora-store` dependency just to name the meta / error types.
60pub use lora_snapshot::{
61    Compression, EncryptionKey, PasswordKdfParams, SnapshotCredentials, SnapshotEncryption,
62    SnapshotInfo, SnapshotOptions, SnapshotPassword, DATABASE_SNAPSHOT_MAGIC,
63};
64pub use lora_store::{
65    NodeId, NodeRecord, RelationshipId, RelationshipRecord, SnapshotError, SnapshotMeta,
66};
67
68// Standalone parsing entry point (does not require building a `Database`).
69pub use lora_parser::parse_query;