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]
fn set<V>(
self,
values: V
) -> UpdateStatement<T, U, V::Changeset, NoReturningClause> where
T: Table,
V: AsChangeset<Target = T>,
UpdateStatement<T, U, V::Changeset, NoReturningClause>: AsQuery,
[src]
self,
values: V
) -> UpdateStatement<T, U, V::Changeset, NoReturningClause> where
T: Table,
V: AsChangeset<Target = T>,
UpdateStatement<T, U, V::Changeset, NoReturningClause>: AsQuery,
Provides the SET
clause of the UPDATE
statement.
See update
for usage examples, or the update
guide for a more exhaustive
set of examples.
fn filter<Predicate>(self, predicate: Predicate) -> Filter<Self, Predicate> where
Self: FilterDsl<Predicate>,
[src]
Self: FilterDsl<Predicate>,
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);
Trait Implementations
impl<T: Debug, U: Debug> Debug for IncompleteUpdateStatement<T, U>
[src]
impl<T, U, Predicate> FilterDsl<Predicate> for IncompleteUpdateStatement<T, U> where
U: WhereAnd<Predicate>,
Predicate: AppearsOnTable<T>,
[src]
U: WhereAnd<Predicate>,
Predicate: AppearsOnTable<T>,
type Output = IncompleteUpdateStatement<T, U::Output>
The type returned by .filter
.
fn filter(self, predicate: Predicate) -> Self::Output
[src]
See the trait documentation.