sea_orm

Derive Macro FromQueryResult

Source
#[derive(FromQueryResult)]
{
    // Attributes available to this derive:
    #[sea_orm]
}
Expand description

Convert a query result into the corresponding Model.

§Attributes

  • skip: Will not try to pull this field from the query result. And set it to the default value of the type.

§Usage

use sea_orm::{entity::prelude::*, FromQueryResult};

#[derive(Debug, FromQueryResult)]
struct SelectResult {
    name: String,
    num_of_fruits: i32,
    #[sea_orm(skip)]
    skip_me: i32,
}