Skip to main content

Query

Trait Query 

Source
pub trait Query: Sized {
    type Row: FromRow;

    const SQL: &'static str;

    // Required method
    fn as_params(&self) -> Box<[&(dyn ToSql + Sync)]>;
}
Expand description

A typed SQL query that can be executed through tokio-postgres.

Required Associated Constants§

Source

const SQL: &'static str

SQL text loaded from the query file.

Required Associated Types§

Source

type Row: FromRow

Row type returned by the query.

Required Methods§

Source

fn as_params(&self) -> Box<[&(dyn ToSql + Sync)]>

Query bind parameters in positional order.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§