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§
Sourcefn push_placeholder(&self, sql: &mut String, index: usize)
fn push_placeholder(&self, sql: &mut String, index: usize)
index counts from 1.
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
Sourcefn engine(&self) -> Engine
fn engine(&self) -> Engine
Which of a module’s migration files apply: SQLite’s where it has its own.
Sourcefn key_lock(&self) -> Option<&'static str>
fn key_lock(&self) -> Option<&'static str>
Locks its one text parameter until the transaction ends; None where commits queue anyway.
Sourcefn qualified(&self, schema: &str, name: &str) -> String
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.
Sourcefn bytes_in_json(&self, column: &str) -> String
fn bytes_in_json(&self, column: &str) -> String
A bytes column as the JSON of loaded child rows holds it: \x and hex.
fn nested_rows(&self, columns: &str, from: &str) -> String
fn binds_arrays(&self) -> bool
Sourcefn drop_every_table(&self) -> Option<&'static str>
fn drop_every_table(&self) -> Option<&'static str>
Answers, one per row, the statements Schema::fresh drops every table with.
Sourcefn text_search(&self, column: &str, words: &str) -> String
fn text_search(&self, column: &str, words: &str) -> String
Without full-text search, the words are found as one piece of text, ignoring case.
fn lowercase(&self, expression: &str) -> String
Sourcefn empty_order(&self, descending: bool) -> &'static str
fn empty_order(&self, descending: bool) -> &'static str
After a nullable column’s direction: empty values sort as Postgres’s do, last ascending.
Sourcefn flags_notify(&self) -> Option<&'static str>
fn flags_notify(&self) -> Option<&'static str>
Committed with a change to the stored flags or settings.
fn shield(&self) -> Option<&'static ShieldSql>
fn feed(&self) -> Option<&'static FeedSql>
fn product_events(&self) -> Option<&'static ProductSql>
Sourcefn live_notify(&self) -> Option<&'static str>
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".