audb 0.1.11

AuDB - Compile-time database application framework with gold files
Documentation
//! # AuDB - Application Database Compiler
//!
//! AuDB is a compile-time framework that transforms database queries and schemas
//! into optimized, type-safe Rust applications with embedded databases.
//!
//! ## Core Concepts
//!
//! - **Gold Files (.au)**: Universal container format for queries, schemas, and config
//! - **Compile-Time**: All parsing, validation, and optimization at build time
//! - **Multi-Language**: Support HyperQL, SQL, Cypher, and more
//! - **Type-Safe**: Compile-time type checking for queries and data
//! - **Single Binary**: Database + queries + server in one executable
//!
//! ## Usage
//!
//! ```ignore
//! use audb::Project;
//!
//! // Load all gold files from a directory
//! let project = Project::from_directory("./gold")?;
//!
//! // Validate the project
//! project.validate()?;
//!
//! // Generate Rust code (typically done in build.rs)
//! let code = project.generate_code()?;
//! ```
//!
//! ## Module Organization
//!
//! - [`parser`]: Gold file parser (`.au` format)
//! - [`model`]: Project model (schemas, queries, config)
//! - [`schema`]: Schema system supporting multiple formats
//! - [`validation`]: Compile-time validation and type checking
//! - [`project`]: Project management and file discovery

pub mod model;
pub mod parser;
pub mod project;
pub mod schema;
pub mod validation;

pub mod error;

// Re-export key types for convenience
pub use error::{Error, Result};
pub use model::{
    Config, DependencyManager, DependencySpec, Project, Query, QueryLanguage, VersionRequirement,
};
pub use parser::{Block, GoldFile, GoldParser};
pub use schema::{Field, Schema, SchemaFormat, Type};
pub use validation::{AstValidator, Validator};

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

/// AuDB core functionality
pub mod prelude {
    pub use crate::error::{Error, Result};
    pub use crate::model::{DependencyManager, DependencySpec, Project, Query, QueryLanguage};
    pub use crate::parser::{GoldFile, GoldParser};
    pub use crate::schema::{Schema, SchemaFormat};
    pub use crate::validation::{AstValidator, Validator};
}

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

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