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
//! Hematite is a small embeddable SQL database written in Rust.
//!
//! It is designed to stay lightweight enough to repurpose and extend while still offering a
//! surprisingly broad SQL surface: DDL, transactions, views, triggers, joins, aggregates, window
//! functions, recursive CTEs, savepoints, rich scalar expressions, and a custom type system.
//!
//! # Quick Start
//!
//! ```no_run
//! use hematite::Hematite;
//!
//! fn main() -> hematite::Result<()> {
//! let mut db = Hematite::new_in_memory()?;
//! db.execute("CREATE TABLE users (id INT PRIMARY KEY, name TEXT);")?;
//! db.execute("INSERT INTO users (id, name) VALUES (1, 'Ada');")?;
//!
//! let names = db.query("SELECT name FROM users ORDER BY id;")?;
//! assert_eq!(names.columns, vec!["name"]);
//! assert_eq!(names.rows.len(), 1);
//! Ok(())
//! }
//! ```
//!
//! # Main Entry Points
//!
//! - [`Hematite`] is the high-level library facade.
//! - [`Connection`] is the lower-level SQL connection boundary.
//! - [`PreparedStatement`] supports repeated execution with parameters.
//! - [`Transaction`] wraps explicit transactions.
//! - [`ResultSet`], [`Row`], and [`StatementResult`] are the primary result types.
//!
//! # Project Layout
//!
//! The core architecture is layered:
//!
//! ```text
//! sql -> parser -> query -> catalog -> btree -> storage
//! ```
//!
//! - `sql`: user-facing API, script stepping, transactions, CLI-facing behavior
//! - `parser`: lexer, AST, and syntax validation
//! - `query`: planning, execution, coercion, metadata shaping
//! - `catalog`: schema, row typing, metadata persistence, logical encoding
//! - `btree`: generic key/value tree over byte payloads
//! - `storage`: pager, WAL/rollback journal, page and row primitives
//!
//! # More Documentation
//!
//! - Repository quick start: `README.md`
//! - Internal architecture guide: `docs/architecture.md`
//! - Module and codebase guide: `docs/codebase-guide.md`
//! - SQL dialect and support matrix: `docs/sql-dialect.md`
pub use ;
pub use ;
pub use Parser;
pub use ;
pub use ;