diesel::backend

Trait SqlDialect

Source
pub trait SqlDialect: TrustedBackend {
    type ReturningClause;
    type OnConflictClause;
    type InsertWithDefaultKeyword;
    type BatchInsertSupport;
    type ConcatClause;
    type DefaultValueClauseForInsert;
    type EmptyFromClauseSyntax;
    type ExistsSyntax;
    type ArrayComparison;
    type SelectStatementSyntax;
    type AliasSyntax;
}
Expand description

This trait provides various options to configure the generated SQL for a specific backend.

Accessing anything from this trait is considered to be part of the public API. Implementing this trait is not considered to be part of diesel’s public API, as future versions of diesel may add additional associated constants here.

Each associated type is used to configure the behaviour of one or more QueryFragment implementations by providing a custom QueryFragment<YourBackend, YourSpecialSyntaxType> implementation to specialize on generic QueryFragment<DB, DB::AssociatedType> implementations.

Required Associated Types§

Source

type ReturningClause

Configures how this backend supports RETURNING clauses

This allows backends to opt in RETURNING clause support and to provide a custom QueryFragment implementation for ReturningClause

Source

type OnConflictClause

Configures how this backend supports ON CONFLICT clauses

This allows backends to opt in ON CONFLICT clause support

Source

type InsertWithDefaultKeyword

Configures how this backend handles the bare DEFAULT keyword for inserting the default value in a INSERT INTO VALUES clause

This allows backends to opt in support for DEFAULT value expressions for insert statements

Source

type BatchInsertSupport

Configures how this backend handles Batch insert statements

This allows backends to provide a custom QueryFragment implementation for BatchInsert

Source

type ConcatClause

Configures how this backend handles the Concat clauses in select statements.

This allows backends to provide a custom QueryFragment implementation for Concat

Source

type DefaultValueClauseForInsert

Configures how this backend handles the DEFAULT VALUES clause for insert statements.

This allows backends to provide a custom QueryFragment implementation for DefaultValues

Source

type EmptyFromClauseSyntax

Configures how this backend handles empty FROM clauses for select statements.

This allows backends to provide a custom QueryFragment implementation for NoFromClause

Source

type ExistsSyntax

Configures how this backend handles EXISTS() expressions.

This allows backends to provide a custom QueryFragment implementation for Exists

Source

type ArrayComparison

Configures how this backend handles IN() and NOT IN() expressions.

This allows backends to provide custom QueryFragment implementations for In, NotIn and Many

Source

type SelectStatementSyntax

Configures how this backend structures SELECT queries

This allows backends to provide custom QueryFragment implementations for SelectStatement and BoxedSelectStatement SelectStatement and BoxedSelectStatement

Source

type AliasSyntax

Configures how this backend structures SELECT queries

This allows backends to provide custom QueryFragment implementations for Alias<T>

Implementors§

Source§

impl SqlDialect for Mysql

Available on crate feature mysql_backend only.
Source§

type ReturningClause = DoesNotSupportReturningClause

Source§

type OnConflictClause = MysqlOnConflictClause

Source§

type InsertWithDefaultKeyword = IsoSqlDefaultKeyword

Source§

type BatchInsertSupport = PostgresLikeBatchInsertSupport

Source§

type DefaultValueClauseForInsert = MysqlStyleDefaultValueClause

Source§

type EmptyFromClauseSyntax = AnsiSqlFromClauseSyntax

Source§

type SelectStatementSyntax = AnsiSqlSelectStatement

Source§

type ExistsSyntax = AnsiSqlExistsSyntax

Source§

type ArrayComparison = AnsiSqlArrayComparison

Source§

type ConcatClause = MysqlConcatClause

Source§

type AliasSyntax = AsAliasSyntax

Source§

impl SqlDialect for Pg

Available on crate feature postgres_backend only.
Source§

type ReturningClause = PgLikeReturningClause

Source§

type OnConflictClause = PgOnConflictClause

Source§

type InsertWithDefaultKeyword = IsoSqlDefaultKeyword

Source§

type BatchInsertSupport = PostgresLikeBatchInsertSupport

Source§

type ConcatClause = ConcatWithPipesClause

Source§

type DefaultValueClauseForInsert = AnsiDefaultValueClause

Source§

type EmptyFromClauseSyntax = AnsiSqlFromClauseSyntax

Source§

type SelectStatementSyntax = AnsiSqlSelectStatement

Source§

type ExistsSyntax = AnsiSqlExistsSyntax

Source§

type ArrayComparison = PgStyleArrayComparison

Source§

type AliasSyntax = AsAliasSyntax

Source§

impl SqlDialect for Sqlite

Available on crate feature sqlite only.
Source§

type ReturningClause = DoesNotSupportReturningClause

Source§

type OnConflictClause = SqliteOnConflictClause

Source§

type InsertWithDefaultKeyword = DoesNotSupportDefaultKeyword

Source§

type BatchInsertSupport = SqliteBatchInsert

Source§

type ConcatClause = ConcatWithPipesClause

Source§

type DefaultValueClauseForInsert = AnsiDefaultValueClause

Source§

type EmptyFromClauseSyntax = AnsiSqlFromClauseSyntax

Source§

type SelectStatementSyntax = AnsiSqlSelectStatement

Source§

type ExistsSyntax = AnsiSqlExistsSyntax

Source§

type ArrayComparison = AnsiSqlArrayComparison

Source§

type AliasSyntax = AsAliasSyntax