FromRow

Derive Macro FromRow 

Source
#[derive(FromRow)]
{
    // Attributes available to this derive:
    #[from_row]
}
Expand description

Derive macro for FromRow trait.

Generates an implementation that matches column names to struct fields.

§Example

#[derive(FromRow)]
struct User {
    name: String,
    age: i32,
}

§Strict Mode

By default, unknown columns are silently skipped. Use #[from_row(strict)] to error on unknown columns:

#[derive(FromRow)]
#[from_row(strict)]
struct User {
    name: String,
    age: i32,
}