Skip to main content

sql_forge_transparent

Attribute Macro sql_forge_transparent 

Source
#[sql_forge_transparent]
Expand description

Marks a single-value tuple struct as a transparent wrapper for use with sql_forge! parameters.

Expands to #[derive(sqlx::Type)] + #[sqlx(transparent)] (needed for all database backends so the type implements sqlx::Encode + sqlx::Type).

#[derive(Debug, PartialEq, Eq)]
#[sql_forge_transparent]
struct UserId(pub i64);