Skip to main content

GatekeepSqlxBackend

Trait GatekeepSqlxBackend 

Source
pub trait GatekeepSqlxBackend:
    Clone
    + Copy
    + Debug
    + Send
    + Sync
    + 'static {
    type Database: Database;

    const DRIVER: SqlxDriver;
    const NAME: &'static str;
    const MIN_FUNCTION: &'static str;
    const MAX_FUNCTION: &'static str;
    const GRADE_FUNCTION_PROPAGATES_NULL: bool;

    // Required methods
    fn push_placeholder(sql: &mut String, index: usize);
    fn push_bind(builder: &mut QueryBuilder<Self::Database>, value: &SqlxValue);
}
Expand description

SQLx backend supported by gatekeep lowering.

Required Associated Constants§

Source

const DRIVER: SqlxDriver

Database driver represented by this backend.

Source

const NAME: &'static str

Stable backend name.

Source

const MIN_FUNCTION: &'static str

Name of the SQL function that returns the lower of two non-null grades.

Source

const MAX_FUNCTION: &'static str

Name of the SQL function that returns the higher of two non-null grades.

Source

const GRADE_FUNCTION_PROPAGATES_NULL: bool

Whether the backend’s grade functions return NULL when any input is NULL.

Required Associated Types§

Source

type Database: Database

SQLx database driver for this backend.

Required Methods§

Source

fn push_placeholder(sql: &mut String, index: usize)

Appends one bind placeholder to rendered SQL.

Source

fn push_bind(builder: &mut QueryBuilder<Self::Database>, value: &SqlxValue)

Appends one typed bind value to a SQLx query builder.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§

Source§

impl GatekeepSqlxBackend for PostgresBackend

Available on crate feature postgres only.
Source§

const DRIVER: SqlxDriver = SqlxDriver::Postgres

Source§

const NAME: &'static str = "postgres"

Source§

const MIN_FUNCTION: &'static str = "LEAST"

Source§

const MAX_FUNCTION: &'static str = "GREATEST"

Source§

const GRADE_FUNCTION_PROPAGATES_NULL: bool = false

Source§

type Database = Postgres