Skip to main content

RelationalTx

Trait RelationalTx 

Source
pub trait RelationalTx: Send {
    // Required methods
    fn execute(
        &mut self,
        sql: &str,
        params: &[Value],
    ) -> impl Future<Output = Result<u64, RelError>> + Send;
    fn query(
        &mut self,
        sql: &str,
        params: &[Value],
    ) -> impl Future<Output = Result<Vec<Row>, RelError>> + Send;
    fn commit(self) -> impl Future<Output = Result<(), RelError>> + Send;
    fn rollback(self) -> impl Future<Output = Result<(), RelError>> + Send;
}
Expand description

A transaction. Statements run inside it are committed or rolled back together.

Required Methods§

Source

fn execute( &mut self, sql: &str, params: &[Value], ) -> impl Future<Output = Result<u64, RelError>> + Send

As RelationalBackend::execute, inside the transaction.

Source

fn query( &mut self, sql: &str, params: &[Value], ) -> impl Future<Output = Result<Vec<Row>, RelError>> + Send

As RelationalBackend::query, inside the transaction.

Source

fn commit(self) -> impl Future<Output = Result<(), RelError>> + Send

Commit.

Source

fn rollback(self) -> impl Future<Output = Result<(), RelError>> + Send

Roll back.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§