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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
//! # FraiseQL Core
//!
//! Core execution engine for FraiseQL v2 - A compiled GraphQL execution engine.
//! ## Architecture
//!
//! FraiseQL v2 compiles GraphQL schemas into optimized SQL execution plans at build time,
//! eliminating runtime overhead and enabling deterministic, high-performance query execution.
//!
//! ### Key Components
//!
//! - **Schema**: Compiled schema representation (types, fields, SQL mappings)
//! - **Compiler**: Parsing, validation, and runtime sub-modules (aggregation, fact tables, window
//! functions)
//! - **Runtime**: Compiled query executor
//! - **Database**: Connection pooling and transaction management
//! - **Cache**: Query result caching with coherency
//! - **Security**: Authentication, authorization, and audit
//! - **APQ**: Automatic Persisted Queries
//!
//! ## Compilation Flow
//!
//! ```text
//! Python/TypeScript Decorators
//! ↓
//! JSON Schema
//! ↓
//! SchemaConverter (fraiseql-cli)
//! ↙ ↓ ↘
//! Parse Validate Convert
//! ↓
//! CompiledSchema.json
//! ↓
//! Runtime
//! ↙ ↓ ↘
//! Match Execute Project
//! ↓
//! GraphQL Response
//! ```
//!
//! ## Example
//!
//! ```no_run
//! // Requires: a compiled schema file and a live PostgreSQL database.
//! // See: tests/integration/ for runnable examples.
//! use fraiseql_core::schema::CompiledSchema;
//! use fraiseql_core::runtime::Executor;
//! use fraiseql_core::db::postgres::PostgresAdapter;
//! use std::sync::Arc;
//!
//! # async fn example() -> Result<(), Box<dyn std::error::Error>> {
//! # let schema_json = r#"{"types":[],"queries":[]}"#;
//! // Load compiled schema
//! let schema = CompiledSchema::from_json(schema_json, false)?;
//!
//! // Create executor (db_pool is a DatabaseAdapter implementation)
//! let db_pool = Arc::new(PostgresAdapter::new("postgresql://localhost/mydb").await?);
//! let executor = Executor::new(schema, db_pool);
//!
//! // Execute query
//! let query = r#"query { users { id name } }"#;
//! let result = executor.execute(query, None).await?;
//!
//! println!("{}", result);
//! # Ok(())
//! # }
//! ```
// Core modules
// Compilation layer
// Execution layer
// GraphQL parsing and query processing
// Infrastructure
/// The `chrono` this crate's public API is built against (#1198).
pub use chrono;
/// The `deadpool_postgres` this crate's public API is built against (#1198).
pub use deadpool_postgres;
/// Core's own handle on the database layer.
///
/// Private on purpose. The *public* `db` module below is a curated subset, and core
/// must not be forced to widen that subset merely to reach something for itself —
/// which is what a single shared re-export would do, and is how the blanket export
/// came to expose the whole data plane.
pub use fraiseql_db as backend;
/// The database layer this crate's public API is built against.
///
/// **Enumerated, not a blanket `pub use fraiseql_db as db;`** (S3 of the boundary
/// work). The blanket form made every item in `fraiseql-db` nameable from any crate
/// that depends on `fraiseql-core` — including the data-plane surface the write
/// chokepoint sits above. Narrowing it is compiler-verified: an item that is not
/// listed is a compile error at the point of use, not a lint that has to be written
/// and then kept in step.
///
/// Adding a line here widens the surface that transports can reach around the
/// engine with. Add one only for a type a transport genuinely needs to *name* —
/// configuration, a trait bound, a value in a signature — never to reach a method.
/// The `graphql_parser` this crate's public API is built against (#1198).
pub use graphql_parser;
/// The `indexmap` this crate's public API is built against (#1198).
pub use indexmap;
/// The `jsonwebtoken` this crate's public API is built against (#1198).
pub use jsonwebtoken;
/// The `regex` this crate's public API is built against (#1198).
pub use regex;
/// The `reqwest` this crate's public API is built against (#1198).
pub use reqwest;
/// The `serde_json` this crate's public API is built against (#1198).
pub use serde_json;
/// The `tokio_postgres` this crate's public API is built against (#1198).
pub use tokio_postgres;
/// The `tracing` this crate's public API is built against (#1198).
pub use tracing;
pub use fraiseql_federation as federation;
// Re-exports for convenience
pub use ;
pub use CompiledSchema;
pub use TenantContext;
/// The `uuid` this crate's public API is built against (#1198).
pub use uuid;
/// The `zeroize` this crate's public API is built against (#1198).
pub use zeroize;
/// Version of the FraiseQL core library
pub const VERSION: &str = env!;
/// Minimum supported Rust version
pub const MSRV: &str = "1.88";