DbBackend

Type Alias DbBackend 

Source
pub type DbBackend = DatabaseBackend;
Expand description

A shorthand for DatabaseBackend.

Aliased Type§

pub enum DbBackend {
    MySql,
    Postgres,
    Sqlite,
}

Variants§

§

MySql

A MySQL backend

§

Postgres

A PostgreSQL backend

§

Sqlite

A SQLite backend

Implementations§

Source§

impl DbBackend

Source

pub fn is_prefix_of(self, base_url: &str) -> bool

Check if the URI is the same as the specified database backend. Returns true if they match.

§Panics

Panics if base_url cannot be parsed as Url.

Source

pub fn build<S>(&self, statement: &S) -> Statement

Build an SQL Statement

Source

pub fn support_returning(&self) -> bool

Check if the database supports RETURNING syntax on insert and update

Source

pub fn boolean_value(&self, boolean: bool) -> Value

A getter for database dependent boolean value

Source

pub fn as_str(&self) -> &'static str

Get the display string for this enum