audb-codegen 0.1.11

Code generation for AuDB compile-time database applications
//! # AuDB Code Generator
//!
//! This crate provides code generation functionality for AuDB projects.
//! It converts the internal Project model into executable Rust code.
//!
//! ## Code Generation Pipeline
//!
//! ```ignore
//! Project Model → CodeGenerator → Rust Source Code → Compilation
//! ```
//!
//! ## Generators
//!
//! - **SchemaGenerator**: Generates Rust structs from schemas
//! - **QueryGenerator**: Generates query functions (TODO)
//! - **EndpointGenerator**: Generates API endpoint handlers (TODO)
//! - **TestGenerator**: Generates integration tests (TODO)
//!
//! ## Usage
//!
//! ```ignore
//! use audb_codegen::SchemaGenerator;
//! use audb::schema::Schema;
//!
//! let generator = SchemaGenerator::new();
//! let code = generator.generate(&schema);
//! ```

pub mod endpoint_gen;
pub mod hyperql;
pub mod naming;
pub mod query_gen;
pub mod relationships;
pub mod schema_gen;
pub mod test_gen;

// Re-export key types for convenience
pub use endpoint_gen::EndpointGenerator;
pub use hyperql::HyperQLCompiler;
pub use naming::{collection_name, pluralize, to_snake_case};
pub use query_gen::QueryGenerator;
pub use relationships::{ForeignKeyInfo, detect_foreign_keys, find_primary_key, to_pascal_case};
pub use schema_gen::SchemaGenerator;
pub use test_gen::TestGenerator;

/// AuDB codegen version
pub const VERSION: &str = env!("CARGO_PKG_VERSION");

#[cfg(test)]
mod tests {
    use super::*;

    #[test]
    fn test_version() {
        assert!(!VERSION.is_empty());
    }
}