Derive Macros
EntityModelβ
The EntityModel derive macro is the 'almighty' macro which automatically generates Entity, Column, and PrimaryKey from a given Model.
Entityβ
The DeriveEntity derive macro will implement EntityTrait for Entity and it assumes Model, Column, PrimaryKey and Relation exist in the current scope. It also provides implementation of Iden and IdenStatic for Entity.
Columnβ
The DeriveColumn derive macro will implement ColumnTrait for Columns. It defines the identifier of each column by implementing Iden and IdenStatic. The EnumIter is also derived, allowing iteration over all enum variants.
Primary Keyβ
The DerivePrimaryKey derive macro will implement PrimaryKeyToColumn for PrimaryKey which defines tedious mappings between primary keys and columns. The EnumIter is also derived, allowing iteration over all enum variants.
Modelβ
The DeriveModel derive macro will implement ModelTrait for Model, which provides setters and getters for all attributes in the model. It also implements FromQueryResult to convert a query result into the corresponding Model.
Active Modelβ
The DeriveActiveModel derive macro will implement ActiveModelTrait for ActiveModel which provides setters and getters for all active values in the active model.
Partial Modelβ
The DerivePartialModel derive macro will implement PartialModelTrait for Model.
Active Enumβ
The DeriveActiveEnum derive macro will implement ActiveEnum for any enums.
Relationβ
The DeriveRelation derive macro will implement RelationTrait for Relation.
RelatedEntityβ
The DeriveRelatedEntity derive macro will implement seaography::RelationBuilder for RelatedEntity enumeration when the seaography feature is enabled
Iterableβ
The EnumIter derive macro will implement Iterable to allow iteration over all enum variants.
Value Typeβ
The DeriveValueType derive macro will implement From<T> for Value, sea_orm::TryGetable for T and sea_query::ValueType for T for T.
Displayβ
The DeriveDisplay derive macro will implement std::fmt::Display for enums.