Skip to main content

aurora_db/
lib.rs

1//! # Aurora Database
2//!
3//! Aurora is an embedded document database with tiered storage architecture.
4//! It provides document storage, querying, indexing, and search capabilities
5//! while optimizing for both performance and durability.
6//!
7//! ## Key Features
8//!
9//! * **Tiered Storage**: Hot in-memory cache + persistent cold storage
10//! * **Document Model**: Schema-flexible JSON-like document storage
11//! * **Querying**: Rich query capabilities with filtering and sorting
12//! * **Full-text Search**: Built-in search engine with relevance ranking
13//! * **Transactions**: ACID-compliant transaction support
14//!
15//! ## Quick Start
16//!
17
18//! use aurora_db::{Aurora, Value, FieldType};
19//!
20//! // Open a database
21//! let db = Aurora::open("my_app.db")?;
22//!
23//! // Create a collection
24//! db.new_collection("users", vec![
25//!     ("name", FieldType::String, false),
26//!     ("email", FieldType::String, true),  // unique field
27//!     ("age", FieldType::Int, false),
28//! ])?;
29//!
30//! // Insert data
31//! let user_id = db.insert_into("users", vec![
32//!     ("name", "Jane Doe"),
33//!     ("email", "jane@example.com"),
34//!     ("age", 28),
35//! ])?;
36//!
37//! // Query data
38//! let users = db.query("users")
39//!     .filter(|f| f.gt("age", 21))
40//!     .collect()
41//!     .await?;
42//! ```
43
44// Re-export primary types and modules
45pub use crate::db::Aurora;
46pub use crate::db::DataInfo;
47pub use crate::error::{AqlError, Result};
48pub use crate::query::{QueryBuilder, SearchBuilder};
49pub use types::{
50    AuroraConfig, ColdStoreMode, Collection, Document, DurabilityMode, FieldDefinition, FieldType,
51    Value,
52};
53
54// Re-export commonly used storage types
55pub use storage::{EvictionPolicy, HotStore};
56
57// Re-export PubSub types for convenience
58pub use pubsub::{ChangeEvent, ChangeListener, ChangeType};
59
60// Re-export Workers types for convenience
61pub use workers::{Job, JobPriority, JobStatus};
62
63// Re-export Transaction types for convenience
64pub use transaction::{TransactionBuffer, TransactionId};
65
66// Module declarations
67pub mod client;
68pub mod computed;
69pub mod db;
70pub mod error;
71pub mod index;
72pub mod network;
73pub mod parser; // AQL parser module
74pub mod pubsub;
75pub mod query;
76pub mod reactive;
77pub mod search;
78pub mod storage;
79pub mod transaction;
80pub mod types;
81pub mod wal;
82pub mod workers;