pub trait Dialect: Send + Sync {
// Required methods
fn name(&self) -> &'static str;
fn quote_identifier(&self, ident: &str) -> String;
fn bind_parameter(&self, index: usize) -> String;
fn supports_returning(&self) -> bool;
}Expand description
Describes how a specific database handles SQL syntax differences.
Required Methods§
Sourcefn quote_identifier(&self, ident: &str) -> String
fn quote_identifier(&self, ident: &str) -> String
Quote an identifier (table name, column name).
- Postgres/SQLite:
"identifier" - MySQL:
`identifier`
Sourcefn bind_parameter(&self, index: usize) -> String
fn bind_parameter(&self, index: usize) -> String
Return the bind parameter placeholder for the given 1-based index.
- Postgres:
$1,$2, … - SQLite/MySQL:
?
Sourcefn supports_returning(&self) -> bool
fn supports_returning(&self) -> bool
Whether this dialect supports the RETURNING clause on INSERT/UPDATE/DELETE.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".