Function diesel::update
[−]
[src]
pub fn update<T: UpdateTarget>(source: T) -> IncompleteUpdateStatement<T>
Creates an update statement. Helpers for updating a single row can be
generated by
#[changeset_for]
.
Example
Examples
Deleting a single record:
let updated_row = diesel::update(users.filter(id.eq(1))) .set(name.eq("James")) .get_result(&connection); // On backends that support it, you can call `get_result` instead of `execute` // to have `RETURNING *` automatically appended to the query. assert_eq!(Ok((1, "James".to_string())), updated_row);