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.

Equivalent to applying #[derive(sqlx::Type)] + #[sqlx(transparent)] and additionally implements SqlForgeValidatorValue so that list parameters (:ids[]) and other bindings validate correctly for PostgreSQL databases (which require exact type matching in query_as!).

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