Derive Macro sea_orm::DerivePrimaryKey

source ·
#[derive(DerivePrimaryKey)]
{
    // Attributes available to this derive:
    #[sea_orm]
}
Expand description

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.

Usage

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

#[derive(Copy, Clone, Debug, EnumIter, DerivePrimaryKey)]
pub enum PrimaryKey {
    CakeId,
    FillingId,
}