logo

Derive Macro sea_orm::entity::prelude::DerivePrimaryKey[][src]

#[derive(DerivePrimaryKey)]
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,
}