Skip to main content

QueryRunner

Trait QueryRunner 

Source
pub trait QueryRunner: Send + Sync {
    // Required methods
    fn run_query(&self, sql: &str, max_rows: u64) -> Result<QueryRows, String>;
    fn columns(&self, sql: &str) -> Result<Vec<Column>, String>;

    // Provided method
    fn load(
        &self,
        _name: &str,
        _table: &Table,
    ) -> Result<Option<(String, Option<String>)>, String> { ... }
}
Expand description

Executes run_query() SQL on the Binding’s own session.

Required Methods§

Source

fn run_query(&self, sql: &str, max_rows: u64) -> Result<QueryRows, String>

Run sql, failing if it returns more than max_rows rows.

Source

fn columns(&self, sql: &str) -> Result<Vec<Column>, String>

The columns sql returns, without fetching rows.

Provided Methods§

Source

fn load( &self, _name: &str, _table: &Table, ) -> Result<Option<(String, Option<String>)>, String>

Load a lookup into a temp table on the session: Some((relation, plugin warning)), or None when the source can’t load rows.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§