update_set

Macro update_set 

Source
update_set!() { /* proc-macro */ }
Expand description

This macro allows providing a set of updates to perform on each row in an sql update statement.

The input to this macro should be a comma seperated list of assignments of sql expressions to columns, for example:

ยงExample

let new_ages = person::table
    .update()
    .set(update_set!(person::age = person::age.add(1)))
    .returning(person::age)
    .load_all_values(...)
    .await?;

#[derive(Table)]
struct Person {
    id: i32,
    age: i32,
}