Attribute Macro scyllax_macros::upsert_query

source ·
#[upsert_query]
Expand description

Apply this attribute to a entity struct to generate an upsert query.

#[upsert_query(table = "person", name = UpsertPerson)]
#[derive(Clone, Debug, FromRow, PartialEq, ValueList, Entity)]
pub struct PersonEntity {
    #[pk]
    pub id: uuid::Uuid,
    pub email: String,
    pub created_at: i64,
}