Skip to main content

Dialect

Trait Dialect 

Source
pub trait Dialect:
    Send
    + Sync
    + Any {
Show 26 methods // Required methods fn push_placeholder(&self, sql: &mut String, index: usize); fn migrations_setup(&self) -> &'static str; fn migrations_lock(&self) -> &'static str; fn enter_schema(&self, schema: &str) -> String; fn framework_migrations(&self) -> Migrations; fn messages(&self) -> &'static MessageSql; // Provided methods fn push_quoted(&self, sql: &mut String, identifier: &str) { ... } fn placeholder(&self, index: usize) -> String { ... } fn quote(&self, identifier: &str) -> String { ... } fn engine(&self) -> Engine { ... } fn key_lock(&self) -> Option<&'static str> { ... } fn shared_key_lock(&self) -> Option<&'static str> { ... } fn qualified(&self, schema: &str, name: &str) -> String { ... } fn bytes_in_json(&self, column: &str) -> String { ... } fn nested_rows(&self, columns: &str, from: &str) -> String { ... } fn binds_arrays(&self) -> bool { ... } fn drop_every_table(&self) -> Option<&'static str> { ... } fn text_search(&self, column: &str, words: &str) -> String { ... } fn lowercase(&self, expression: &str) -> String { ... } fn empty_order(&self, descending: bool) -> &'static str { ... } fn enter_role(&self, module: Option<&str>) -> Option<String> { ... } fn flags_notify(&self) -> Option<&'static str> { ... } fn shield(&self) -> Option<&'static ShieldSql> { ... } fn feed(&self) -> Option<&'static FeedSql> { ... } fn product_events(&self) -> Option<&'static ProductSql> { ... } fn live_notify(&self) -> Option<&'static str> { ... }
}
Expand description

Rendered SQL is cached by the dialect’s type, so it must not vary per instance.

Required Methods§

Source

fn push_placeholder(&self, sql: &mut String, index: usize)

index counts from 1.

Source

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

Source

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

Source

fn enter_schema(&self, schema: &str) -> String

Source

fn framework_migrations(&self) -> Migrations

Source

fn messages(&self) -> &'static MessageSql

Provided Methods§

Source

fn push_quoted(&self, sql: &mut String, identifier: &str)

Source

fn placeholder(&self, index: usize) -> String

Source

fn quote(&self, identifier: &str) -> String

Source

fn engine(&self) -> Engine

Which of a module’s migration files apply: SQLite’s where it has its own.

Source

fn key_lock(&self) -> Option<&'static str>

Locks its one text parameter until the transaction ends; None where commits queue anyway.

Source

fn shared_key_lock(&self) -> Option<&'static str>

Source

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

A module’s table: in its schema, or named after it where the database has no schemas.

Source

fn bytes_in_json(&self, column: &str) -> String

A bytes column as the JSON of loaded child rows holds it: \x and hex.

Source

fn nested_rows(&self, columns: &str, from: &str) -> String

Source

fn binds_arrays(&self) -> bool

Source

fn drop_every_table(&self) -> Option<&'static str>

Answers, one per row, the statements Schema::fresh drops every table with.

Without full-text search, the words are found as one piece of text, ignoring case.

Source

fn lowercase(&self, expression: &str) -> String

Source

fn empty_order(&self, descending: bool) -> &'static str

After a nullable column’s direction: empty values sort as Postgres’s do, last ascending.

Source

fn enter_role(&self, module: Option<&str>) -> Option<String>

None returns to the app’s login.

Source

fn flags_notify(&self) -> Option<&'static str>

Committed with a change to the stored flags or settings.

Source

fn shield(&self) -> Option<&'static ShieldSql>

Source

fn feed(&self) -> Option<&'static FeedSql>

Source

fn product_events(&self) -> Option<&'static ProductSql>

Source

fn live_notify(&self) -> Option<&'static str>

Sends its one text parameter to every instance’s Driver::change_notifications.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§