Crate audb

Crate audb 

Source
Expand description

§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

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

Re-exports§

pub use error::Error;
pub use error::Result;
pub use model::Config;
pub use model::DependencyManager;
pub use model::DependencySpec;
pub use model::Project;
pub use model::Query;
pub use model::QueryLanguage;
pub use model::VersionRequirement;
pub use parser::Block;
pub use parser::GoldFile;
pub use parser::GoldParser;
pub use schema::Field;
pub use schema::Schema;
pub use schema::SchemaFormat;
pub use schema::Type;
pub use validation::AstValidator;
pub use validation::Validator;

Modules§

error
Error types for AuDB core
model
Project model types
parser
Gold file parser for .au files
prelude
AuDB core functionality
project
Project management and file discovery
schema
Schema system for AuDB
validation
Validation and type checking for AuDB projects

Constants§

VERSION
AuDB version