Dialect

Trait Dialect 

Source
pub trait Dialect {
    // Required method
    fn name(&self) -> &'static str;

    // Provided methods
    fn identifier_quote(&self) -> char { ... }
    fn string_escape(&self) -> &'static str { ... }
    fn parameter_placeholder(&self) -> &'static str { ... }
    fn supports_returning(&self) -> bool { ... }
    fn supports_upsert(&self) -> bool { ... }
    fn supports_limit_offset(&self) -> bool { ... }
    fn quote_identifier(&self, name: &str) -> String { ... }
}
Expand description

Trait for SQL dialect-specific behavior.

Required Methods§

Source

fn name(&self) -> &'static str

Returns the name of the dialect.

Provided Methods§

Source

fn identifier_quote(&self) -> char

Returns the identifier quote character (e.g., " for standard SQL, ` for MySQL).

Source

fn string_escape(&self) -> &'static str

Returns the string escape character.

Source

fn parameter_placeholder(&self) -> &'static str

Returns the parameter placeholder style.

Source

fn supports_returning(&self) -> bool

Returns whether the dialect supports RETURNING clause.

Source

fn supports_upsert(&self) -> bool

Returns whether the dialect supports UPSERT (ON CONFLICT).

Source

fn supports_limit_offset(&self) -> bool

Returns whether the dialect supports LIMIT with OFFSET.

Source

fn quote_identifier(&self, name: &str) -> String

Quotes an identifier if necessary.

Implementors§