Struct diesel::query_builder::update_statement::UpdateStatement [] [src]

pub struct UpdateStatement<T, U, V> {
    // some fields omitted
}

Methods

impl<T, U, V> UpdateStatement<T, U, V>
[src]

fn returning<E>(self, returns: E) -> UpdateQuery<E, Self> where T: Table, UpdateQuery<E, Self>: Query

Specify what expression is returned after execution of the update.

Examples

Updating a single record:

let updated_name = diesel::update(users.filter(id.eq(1)))
    .set(name.eq("Dean"))
    .returning(name)
    .get_result(&connection);
assert_eq!(Ok("Dean".to_string()), updated_name);

Trait Implementations

impl<T: Clone, U: Clone, V: Clone> Clone for UpdateStatement<T, U, V>
[src]

fn clone(&self) -> UpdateStatement<T, U, V>

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)
1.0.0

Performs copy-assignment from source. Read more

impl<T: Copy, U: Copy, V: Copy> Copy for UpdateStatement<T, U, V>
[src]

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

fn fmt(&self, __arg_0: &mut Formatter) -> Result

Formats the value using the given formatter.

impl<T, U, V, DB> QueryFragment<DB> for UpdateStatement<T, U, V> where DB: Backend, T: Table, T::FromClause: QueryFragment<DB>, U: QueryFragment<DB>, V: Changeset<DB>
[src]

fn to_sql(&self, out: &mut DB::QueryBuilder) -> BuildQueryResult

fn collect_binds(&self, out: &mut DB::BindCollector) -> QueryResult<()>

fn is_safe_to_cache_prepared(&self) -> bool

impl<T, U, V> QueryId for UpdateStatement<T, U, V>
[src]

impl<T, U, V> AsQuery for UpdateStatement<T, U, V> where T: Table, UpdateQuery<T::AllColumns, UpdateStatement<T, U, V>>: Query
[src]

type SqlType = Self::Query::SqlType

type Query = UpdateQuery<T::AllColumns, Self>

fn as_query(self) -> Self::Query