Expand description
Procedural macros for generating CRUD operations from Sea-ORM entities.
Main macro: #[derive(EntityToModels)] - see entity_to_models
Module guide: fields/ (field processing) | codegen/ (models, handlers, joins, routes)
Derive Macrosยง
- Entity
ToModels - Generates complete CRUD API structures from Sea-ORM entities.
- ToCreate
Model - Generates
<Name>Createstruct with fields not excluded byexclude(create). Fields withon_createbecomeOption<T>to allow user override. ImplementsFrom<NameCreate>forActiveModelwith automatic value generation. - ToList
Model - Generates
<Name>Liststruct with fields not excluded byexclude(list). Optimizes API payloads by excluding heavy fields (joins, large text) from list endpoints. ImplementsFrom<Name>andFrom<Model>conversions. - ToUpdate
Model - Generates
<Name>Updatestruct with fields not excluded byexclude(update). All fields areOption<Option<T>>to support partial updates and explicit null. ImplementsMergeIntoActiveModeltrait withon_updateexpression handling.