ferriorm_codegen/lib.rs
1//! Code generator that produces a type-safe Rust client from a validated schema.
2//!
3//! Given an [`ferriorm_core::schema::Schema`], this crate emits a complete Rust
4//! module tree consisting of:
5//!
6//! - **Model structs** with `sqlx::FromRow` derives ([`model`])
7//! - **Enum definitions** with `sqlx::Type` derives ([`enums`])
8//! - **Filter / order / data submodules** for type-safe queries ([`model`])
9//! - **Relation types** and batched include loading ([`relations`])
10//! - **`FerriormClient`** -- the entry-point struct users interact with ([`client`])
11//!
12//! The main entry point is [`generator::generate`], which writes all files to
13//! the configured output directory.
14//!
15//! # Related crates
16//!
17//! - `ferriorm_core` -- the `Schema` IR consumed by this crate.
18//! - `ferriorm_parser` -- parses `.ferriorm` files into the `Schema` IR.
19//! - `ferriorm_runtime` -- the runtime library that generated code depends on.
20
21pub mod client;
22pub mod enums;
23pub mod formatter;
24pub mod generator;
25pub mod model;
26pub mod relations;
27
28mod rust_type;