pub trait Dialect {
// Required methods
fn render_select(&self, select: &Select) -> Result<Sql>;
fn render_insert(&self, insert: &Insert) -> Result<Sql>;
fn render_update(&self, update: &Update) -> Result<Sql>;
fn render_delete(&self, delete: &Delete) -> Result<Sql>;
// Provided method
fn supports_returning(&self) -> bool { ... }
}Expand description
Trait for SQL dialect renderers.
Allows rendering AST queries into dialect-specific SQL strings.
Required Methods§
Sourcefn render_select(&self, select: &Select) -> Result<Sql>
fn render_select(&self, select: &Select) -> Result<Sql>
Render a SELECT query into SQL.
Sourcefn render_insert(&self, insert: &Insert) -> Result<Sql>
fn render_insert(&self, insert: &Insert) -> Result<Sql>
Render an INSERT query into SQL.
Sourcefn render_update(&self, update: &Update) -> Result<Sql>
fn render_update(&self, update: &Update) -> Result<Sql>
Render an UPDATE query into SQL.
Sourcefn render_delete(&self, delete: &Delete) -> Result<Sql>
fn render_delete(&self, delete: &Delete) -> Result<Sql>
Render a DELETE query into SQL.
Provided Methods§
Sourcefn supports_returning(&self) -> bool
fn supports_returning(&self) -> bool
Whether this dialect natively supports the RETURNING clause on INSERT, UPDATE, and DELETE statements.
Dialects that return false (e.g. MySQL) will have RETURNING
emulated at the connector layer via separate queries.
Implementors§
impl Dialect for MysqlDialect
Renders query ASTs into MySQL-compatible SQL with ? placeholders
and backtick-quoted identifiers.
impl Dialect for PostgresDialect
impl Dialect for SqliteDialect
Renders query ASTs into SQLite-compatible SQL with ? placeholders
and double-quoted identifiers.