Struct diesel::query_builder::IncompleteUpdateStatement [] [src]

pub struct IncompleteUpdateStatement<T, U>(_);

The type returned by update. The only thing you can do with this type is call set on it.

Methods

impl<T, U> IncompleteUpdateStatement<T, U>
[src]

[src]

Provides the SET clause of the UPDATE statement.

See update for usage examples, or the update guide for a more exhaustive set of examples.

Trait Implementations

impl<T: Debug, U: Debug> Debug for IncompleteUpdateStatement<T, U>
[src]

[src]

Formats the value using the given formatter.

impl<T, U, Predicate> FilterDsl<Predicate> for IncompleteUpdateStatement<T, U> where
    U: WhereAnd<Predicate>,
    Predicate: AppearsOnTable<T>, 
[src]

[src]

Adds the given predicate to the WHERE clause of the statement being constructed.

If there is already a WHERE clause, the predicate will be appended with AND. There is no difference in behavior between update(table.filter(x)) and update(table).filter(x).

Example

let updated_rows = diesel::update(users)
    .filter(name.eq("Sean"))
    .set(name.eq("Jim"))
    .execute(&connection);
assert_eq!(Ok(1), updated_rows);

let expected_names = vec!["Jim".to_string(), "Tess".to_string()];
let names = users.select(name).order(id).load(&connection);

assert_eq!(Ok(expected_names), names);