Skip to main content

Executor

Trait Executor 

Source
pub trait Executor {
    // Required methods
    fn execute(&mut self, query: &str, params: &[&dyn ToSql]) -> OrmResult<u64>;
    fn query(
        &mut self,
        query: &str,
        params: &[&dyn ToSql],
    ) -> OrmResult<Vec<Row>>;
}
Expand description

A trait for types that can execute SQL queries and return results.

Implemented by PgPool, PgConnection, and Transaction.

Required Methods§

Source

fn execute(&mut self, query: &str, params: &[&dyn ToSql]) -> OrmResult<u64>

Executes a command (e.g., INSERT, UPDATE, DELETE) and returns the number of affected rows.

Source

fn query(&mut self, query: &str, params: &[&dyn ToSql]) -> OrmResult<Vec<Row>>

Executes a query and returns the resulting rows.

Implementors§