UpdateStatement

Trait UpdateStatement 

Source
pub trait UpdateStatement: Sized {
    type OutputFields: FieldsConsListItem;
    type UpdateTable: Table;
    type HasWhereClause: TypedBool;
    type HasReturningClause: TypedBool;
    type UpdateSet: UpdateSet;

    // Required methods
    fn write_update_set<'s, 'a>(
        &'s self,
        f: &mut String,
        parameter_binder: &mut ParameterBinder<'a>,
    ) -> Result
       where 's: 'a;
    fn write_where_clause<'s, 'a>(
        &'s self,
        f: &mut String,
        parameter_binder: &mut ParameterBinder<'a>,
    ) -> Result
       where 's: 'a;
    fn write_returning_clause<'s, 'a>(
        &'s self,
        f: &mut String,
        parameter_binder: &mut ParameterBinder<'a>,
    ) -> Result
       where 's: 'a;

    // Provided method
    fn write_sql_string<'s, 'a>(
        &'s self,
        f: &mut String,
        parameter_binder: &mut ParameterBinder<'a>,
    ) -> Result
       where 's: 'a { ... }
}
Expand description

Represents any type of sql update statement.

Required Associated Types§

Source

type OutputFields: FieldsConsListItem

A type identifying the output fields of this update statement, selected in its RETURNING clause.

Source

type UpdateTable: Table

The table that this statement updates.

Source

type HasWhereClause: TypedBool

Does this update statement have a WHERE clause?

Source

type HasReturningClause: TypedBool

Does this update statement have a RETURNING clause?

Source

type UpdateSet: UpdateSet

The update set which this update statement should perform on each row which matches the condition.

Required Methods§

Source

fn write_update_set<'s, 'a>( &'s self, f: &mut String, parameter_binder: &mut ParameterBinder<'a>, ) -> Result
where 's: 'a,

Writes the update set of this update statement.

This is a list of comma seperated assignments to columns of the table.

Source

fn write_where_clause<'s, 'a>( &'s self, f: &mut String, parameter_binder: &mut ParameterBinder<'a>, ) -> Result
where 's: 'a,

Writes the WHERE clause of this update statement.

Source

fn write_returning_clause<'s, 'a>( &'s self, f: &mut String, parameter_binder: &mut ParameterBinder<'a>, ) -> Result
where 's: 'a,

Writes the RETURNING clause of this update statement.

Provided Methods§

Source

fn write_sql_string<'s, 'a>( &'s self, f: &mut String, parameter_binder: &mut ParameterBinder<'a>, ) -> Result
where 's: 'a,

Writes this update statement as an sql string.

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§