Expand description
Code generator that produces a type-safe Rust client from a validated schema.
Given an ferriorm_core::schema::Schema, this crate emits a complete Rust
module tree consisting of:
- Model structs with
sqlx::FromRowderives (model) - Enum definitions with
sqlx::Typederives (enums) - Filter / order / data submodules for type-safe queries (
model) - Relation types and batched include loading (
relations) FerriormClient– the entry-point struct users interact with (client)
The main entry point is generator::generate, which writes all files to
the configured output directory.
§Related crates
ferriorm_core– theSchemaIR consumed by this crate.ferriorm_parser– parses.ferriormfiles into theSchemaIR.ferriorm_runtime– the runtime library that generated code depends on.
Modules§
- client
- Generates the
client.rsmodule containing theFerriormClientstruct. - enums
- Generates the
enums.rsmodule from schema enum definitions. - formatter
- Source code formatting for generated Rust code.
- generator
- Top-level code generation orchestrator.
- model
- Generates per-model Rust modules (struct, filters, data inputs, ordering, CRUD).
- relations
- Code generation for relation support: Include, WithRelations, batched loading.