[][src]Trait wundergraph::query_builder::mutations::HandleUpdate

pub trait HandleUpdate<L, U, DB, Ctx> {
    fn handle_update(
        selection: Option<&[Selection<WundergraphScalarValue>]>,
        executor: &Executor<Ctx, WundergraphScalarValue>,
        update: &U
    ) -> ExecutionResult<WundergraphScalarValue>; }

A trait to handle update mutations for database entities

Type parameters:

  • Self: database table type for diesel
  • U: data to update into the table. This type should contain information which entry should be updated (by containing the primary key) and the data that should be actually updated
  • DB: Backend type from diesel, so one of Pg or Sqlite
  • Ctx: The used wundergraph context type

A default implementation is provided for all types implementing diesel::AsChangeset

Required methods

fn handle_update(
    selection: Option<&[Selection<WundergraphScalarValue>]>,
    executor: &Executor<Ctx, WundergraphScalarValue>,
    update: &U
) -> ExecutionResult<WundergraphScalarValue>

Actual function called to insert a database entity

Loading content...

Implementors

impl<L, U, DB, Ctx, T> HandleUpdate<L, U, DB, Ctx> for T where
    T: Table + HasTable<Table = T> + FindDsl<<&'static U as Identifiable>::Id> + 'static,
    DB: Backend + ApplyOffset + 'static,
    DB::QueryBuilder: Default,
    T::FromClause: QueryFragment<DB>,
    L: LoadingHandler<DB, Ctx, Table = T>,
    L::Columns: BuildOrder<T, DB> + BuildSelect<T, DB, SqlTypeOfPlaceholder<L::FieldList, DB, L::PrimaryKeyIndex, T, Ctx>>,
    Ctx: WundergraphContext + QueryModifier<L, DB>,
    Ctx::Connection: Connection<Backend = DB>,
    L::FieldList: WundergraphFieldList<DB, L::PrimaryKeyIndex, T, Ctx>,
    T: BoxedDsl<'static, DB, Output = BoxedSelectStatement<'static, SqlTypeOf<<T as Table>::AllColumns>, T, DB>>,
    <L::Filter as BuildFilter<DB>>::Ret: AppearsOnTable<T>,
    U: 'static,
    &'static U: AsChangeset<Target = T> + Identifiable + HasTable<Table = T>,
    Find<T, <&'static U as Identifiable>::Id>: IntoUpdateTarget<Table = T>,
    <Find<T, <&'static U as Identifiable>::Id> as IntoUpdateTarget>::WhereClause: QueryFragment<DB>,
    <&'static U as AsChangeset>::Changeset: QueryFragment<DB>,
    T::PrimaryKey: EqAll<<&'static U as Identifiable>::Id> + Default,
    DB: HasSqlType<SqlTypeOfPlaceholder<L::FieldList, DB, L::PrimaryKeyIndex, T, Ctx>>,
    <T::PrimaryKey as EqAll<<&'static U as Identifiable>::Id>>::Output: AppearsOnTable<T> + NonAggregate + QueryFragment<DB>, 
[src]

Loading content...