Skip to main content

toasty_core/driver/
dialect.rs

1/// The SQL dialect a driver speaks.
2///
3/// Everything Toasty renders as SQL is a function of the dialect, not of the
4/// live connection, so the dialect is named on
5/// [`Capability::sql`](super::Capability::sql) rather than discovered from a
6/// driver at runtime.
7///
8/// Dialect-compatible engines share a variant: Turso reports
9/// [`Sqlite`](Self::Sqlite) because it accepts SQLite's SQL.
10///
11/// # Examples
12///
13/// ```
14/// use toasty_core::driver::{Capability, Dialect};
15///
16/// assert_eq!(Capability::SQLITE.sql, Some(Dialect::Sqlite));
17/// assert_eq!(Capability::DYNAMODB.sql, None);
18/// ```
19#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
20pub enum Dialect {
21    /// SQLite, and engines that accept SQLite's SQL.
22    Sqlite,
23
24    /// PostgreSQL.
25    Postgresql,
26
27    /// MySQL.
28    Mysql,
29}