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
//! Project model types
//!
//! This module contains the internal representation of an AuDB project,
//! combining all gold files into a unified model for code generation.
//!
//! ## Model Architecture
//!
//! The model layer converts parsed AST (from the parser module) into a
//! domain-specific representation optimized for code generation:
//!
//! - **Project**: Top-level container for all project metadata and resources
//! - **Schema**: Type-safe schema definitions with Field types
//! - **Query**: Database queries with typed parameters and return values
//! - **Endpoint**: REST API endpoint specifications
//! - **Dependencies**: Cargo dependency management
//!
//! ## Conversion Pipeline
//!
//! ```ignore
//! GoldFile (AST) → Project::from_gold_files() → Project (Model)
//! ```
//!
//! The conversion process:
//! 1. Parse multiple gold files into AST
//! 2. Validate AST structure
//! 3. Convert AST blocks to model types
//! 4. Merge resources from multiple files
//! 5. Build unified project model
//!
//! ## Usage
//!
//! ```ignore
//! use audb::model::Project;
//! use audb::parser::GoldParser;
//!
//! // Parse gold files
//! let file1 = GoldParser::parse_file("schemas.au")?;
//! let file2 = GoldParser::parse_file("queries.au")?;
//!
//! // Convert to project model
//! let project = Project::from_gold_files(vec![file1, file2])?;
//!
//! // Query the model
//! let user_schema = project.get_schema("User").unwrap();
//! let get_user_query = project.get_query("get_user").unwrap();
//! ```
// Re-export key types for convenience
pub use ;
pub use ;
pub use ;
// Re-export for backward compatibility
pub use DatabaseConfig as Config;