diesel::query_dsl

Trait UpdateAndFetchResults

Source
pub trait UpdateAndFetchResults<Changes, Output>: Connection {
    // Required method
    fn update_and_fetch(&mut self, changeset: Changes) -> QueryResult<Output>;
}
Expand description

A trait defining how to update a record and fetch the updated entry on a certain backend.

The only case where it is required to work with this trait is while implementing a new connection type. Otherwise use SaveChangesDsl

For implementing this trait for a custom backend:

  • The Changes generic parameter represents the changeset that should be stored
  • The Output generic parameter represents the type of the response.

Required Methods§

Source

fn update_and_fetch(&mut self, changeset: Changes) -> QueryResult<Output>

See the traits documentation.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<'b, Changes, Output> UpdateAndFetchResults<Changes, Output> for MysqlConnection
where Changes: Copy + Identifiable + AsChangeset<Target = <Changes as HasTable>::Table> + IntoUpdateTarget, Changes::Table: FindDsl<Changes::Id>, Update<Changes, Changes>: ExecuteDsl<MysqlConnection>, Find<Changes::Table, Changes::Id>: LoadQuery<'b, MysqlConnection, Output>, <Changes::Table as Table>::AllColumns: ValidGrouping<()>, <<Changes::Table as Table>::AllColumns as ValidGrouping<()>>::IsAggregate: MixedAggregates<No, Output = No>,

Available on crate feature mysql only.
Source§

impl<'b, Changes, Output> UpdateAndFetchResults<Changes, Output> for PgConnection
where Changes: Copy + AsChangeset<Target = <Changes as HasTable>::Table> + IntoUpdateTarget, Update<Changes, Changes>: LoadQuery<'b, PgConnection, Output>, <Changes::Table as Table>::AllColumns: ValidGrouping<()>, <<Changes::Table as Table>::AllColumns as ValidGrouping<()>>::IsAggregate: MixedAggregates<No, Output = No>,

Available on crate feature postgres only.
Source§

impl<'b, Changes, Output> UpdateAndFetchResults<Changes, Output> for SqliteConnection
where Changes: Copy + Identifiable + AsChangeset<Target = <Changes as HasTable>::Table> + IntoUpdateTarget, Changes::Table: FindDsl<Changes::Id>, Update<Changes, Changes>: ExecuteDsl<SqliteConnection>, Find<Changes::Table, Changes::Id>: LoadQuery<'b, SqliteConnection, Output>, <Changes::Table as Table>::AllColumns: ValidGrouping<()>, <<Changes::Table as Table>::AllColumns as ValidGrouping<()>>::IsAggregate: MixedAggregates<No, Output = No>,

Available on crate feature sqlite only.
Source§

impl<Changes, Output, M> UpdateAndFetchResults<Changes, Output> for PooledConnection<M>
where M: ManageConnection, M::Connection: UpdateAndFetchResults<Changes, Output>, Self: Connection,

Available on crate feature r2d2 only.