Trait Update

Source
pub trait Update<'until_build, 'post_build> {
    // Required methods
    fn rollback_transaction(self) -> Self;
    fn where_clause(
        self,
        condition: &'until_build Condition<'post_build>,
    ) -> Self;
    fn add_update(
        self,
        column_name: &'until_build str,
        column_value: Value<'post_build>,
    ) -> Self;
    fn build(self) -> Result<(String, Vec<Value<'post_build>>), Error>;
}
Expand description

Trait representing a update builder.

Required Methods§

Source

fn rollback_transaction(self) -> Self

Turns on ROLLBACK mode.

Only useful in case of an active transaction.

If the insert fails, the complete transaction will be rolled back. The default case is to just stop the transaction, but not rollback any prior successful executed queries.

Source

fn where_clause(self, condition: &'until_build Condition<'post_build>) -> Self

Adds a Condition to the update query.

Source

fn add_update( self, column_name: &'until_build str, column_value: Value<'post_build>, ) -> Self

Add an update

Parameter:

  • column_name: The column name to set the value to.
  • column_value: The value to set the column to.
Source

fn build(self) -> Result<(String, Vec<Value<'post_build>>), Error>

Builds the given statement.

The query_string as well a list of values to bind are returned.

This function returns an error, if no update statements are given previously.

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<'until_build, 'post_build> Update<'until_build, 'post_build> for UpdateImpl<'until_build, 'post_build>