pub async fn update<'post_build>(
executor: impl Executor<'_>,
model: &str,
updates: &[(&str, Value<'post_build>)],
condition: Option<&Condition<'post_build>>
) -> Result<u64, Error>
Expand description
This method is used to update rows in a table.
Parameter:
model
: Name of the model to update rows fromupdates
: A list of updates. An update is a tuple that consists of a list of columns to update as well as the value to set to the columns.condition
: Optional condition to apply.transaction
: Optional transaction to execute the query on.
Returns the rows affected from the update statement. Note that this also includes relations, etc.