DeriveModel

Derive Macro DeriveModel 

Source
#[derive(DeriveModel)]
{
    // Attributes available to this derive:
    #[sea_orm]
}
Available on crate feature macros only.
Expand description

The DeriveModel derive macro will implement ModelTrait for Model, which provides setters and getters for all attributes in the mod It also implements FromQueryResult to convert a query result into the corresponding Model.

ยงUsage

use sea_orm::entity::prelude::*;

#[derive(Clone, Debug, PartialEq, DeriveModel, DeriveActiveModel)]
pub struct Model {
    pub id: i32,
    pub name: String,
}