[][src]Derive Macro postgres_query::FromSqlRow

#[derive(FromSqlRow)]

Extract values from a row.

  • If used on a tuple struct, values will be extracted from the corresponding columns based on their position in the tuple.
  • If used on a stuct with named fields, values will be extracted from the column with the same name as the field.

Example

#[derive(FromSqlRow)]
struct TupleData(i32, String);

#[derive(FromSqlRow)]
struct NamedData {
    age: i32,
    name: String,
};