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
//! AuDB Runtime Library
//!
//! Minimal runtime support for code generated by `audb-codegen`.
//!
//! This crate provides the essential types and traits needed by generated code
//! to execute queries against a database. The runtime is intentionally minimal,
//! with most work (parsing, validation, optimization) happening at compile time.
//!
//! ## Core Components
//!
//! - **`Database`** - Connection wrapper with async query execution methods
//! - **`QueryError`** - Comprehensive error types for runtime failures
//! - **`QueryResult`, `Row`, `Value`** - Type system for query results
//! - **`QueryExecutor`** - Trait for type-safe async query execution
//! - **`FromRow`** - Trait for deserializing rows into Rust types
//!
//! ## Design Philosophy
//!
//! The runtime follows a compile-time-first approach:
//! - Queries are parsed and validated at build time
//! - Type checking happens during compilation
//! - Optimization is done by the code generator
//! - Runtime only handles execution and result deserialization
//!
//! This results in:
//! - **Zero runtime parsing overhead**
//! - **Compile-time type safety**
//! - **Minimal binary size contribution** (~1MB)
//! - **Excellent performance** (no query interpretation)
//!
//! ## Example Usage
//!
//! ```no_run
//! use audb_runtime::{Database, QueryError};
//!
//! async fn example() -> Result<(), QueryError> {
//! // Open database connection
//! let db = Database::open("./data").await?;
//!
//! // Execute queries (typically via generated code)
//! let result = db.execute_hyperql("SELECT * FROM users").await?;
//!
//! // Clean shutdown
//! db.close().await?;
//! Ok(())
//! }
//! ```
//!
//! ## Integration with Generated Code
//!
//! The runtime is designed to work seamlessly with code generated by `audb-codegen`.
//! Generated query functions use the `Database` methods and `FromRow` trait to
//! provide type-safe, compile-time-checked query execution.
//!
//! ## Module Organization
//!
//! - `database` - Database connection and query execution
//! - `error` - Error types and utilities
//! - `types` - Result types (QueryResult, Row, Value)
//! - `executor` - Traits for type-safe execution and deserialization
pub use Database;
pub use ;
pub use ;
pub use ;