1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
//! # Aurora Database
//!
//! Aurora is a high-performance, embedded document database designed for speed,
//! durability, and developer ergonomics. It features a tiered storage architecture
//! combining a blazing-fast in-memory cache with reliable, persistent cold storage.
//!
//! ## Core Architecture
//! - **Tiered Storage**: Automatically manages data between a "hot" cache (DashMap/Moka)
//! and "cold" storage (Sled/MMAP) for optimal performance.
//! - **AQL (Aurora Query Language)**: A GraphQL-inspired query language for powerful
//! data retrieval, manipulation, and real-time subscriptions.
//! - **Roaring Bitmaps**: Uses Roaring Bitmaps for high-performance secondary indexing
//! and bitwise query optimization.
//! - **Write-Ahead Logging (WAL)**: Ensures crash-consistency and data durability.
//!
//! ## Quick Start
//!
//! ```rust
//! use aurora_db::{Aurora, doc, object, FieldType};
//!
//! #[tokio::main]
//! async fn main() -> Result<(), Box<dyn std::error::Error>> {
//! // Open or create a database
//! let db = Aurora::open("my_database.db").await?;
//!
//! // Define a collection with schema
//! db.new_collection("users", vec![
//! ("name", FieldType::SCALAR_STRING, false),
//! ("email", FieldType::SCALAR_STRING, true), // Unique constraint
//! ("age", FieldType::SCALAR_INT, false),
//! ]).await?;
//!
//! // Insert a document using the object! macro
//! let user_id = db.insert_map("users", object!({
//! "name": "Jane Doe",
//! "email": "jane@example.com",
//! "age": 28
//! }).as_object().unwrap().clone()).await?;
//!
//! // Run a parametrized AQL query using the doc! macro
//! let result = db.execute(doc!(
//! "query($minAge: Int) {
//! users(where: { age: { gte: $minAge } }) {
//! name
//! email
//! }
//! }",
//! { "minAge": 21 }
//! )).await?;
//!
//! // Bind the results back to a Rust struct
//! #[derive(serde::Deserialize, Debug)]
//! struct User { name: String, email: String }
//! let users: Vec<User> = result.bind()?;
//!
//! Ok(())
//! }
//! ```
// Re-export primary types and modules
pub use crateAurora;
pub use crate;
pub use crate;
pub use ;
pub use crate;
// Re-export AQL execution types for convenience
pub use crate;
// Re-export commonly used storage types
pub use ;
// Re-export PubSub types for convenience
pub use ;
// Re-export Workers types for convenience
pub use ;
// Re-export Transaction types for convenience
pub use ;
// Module declarations
// AQL parser module