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§
Provided Methods§
Sourcefn identifier_quote(&self) -> char
fn identifier_quote(&self) -> char
Returns the identifier quote character (e.g., " for standard SQL, ` for MySQL).
Sourcefn string_escape(&self) -> &'static str
fn string_escape(&self) -> &'static str
Returns the string escape character.
Sourcefn parameter_placeholder(&self) -> &'static str
fn parameter_placeholder(&self) -> &'static str
Returns the parameter placeholder style.
Sourcefn supports_returning(&self) -> bool
fn supports_returning(&self) -> bool
Returns whether the dialect supports RETURNING clause.
Sourcefn supports_upsert(&self) -> bool
fn supports_upsert(&self) -> bool
Returns whether the dialect supports UPSERT (ON CONFLICT).
Sourcefn supports_limit_offset(&self) -> bool
fn supports_limit_offset(&self) -> bool
Returns whether the dialect supports LIMIT with OFFSET.
Sourcefn quote_identifier(&self, name: &str) -> String
fn quote_identifier(&self, name: &str) -> String
Quotes an identifier if necessary.