reylo-engine-core 0.8.2

What every database's analysis engine shares: the request protocol and its host, the placeholder lexer, the project file, the type model and its JSON Schema, structured parameters, and the WebAssembly ABI each database's artifact exports.
Documentation
//! The dialects the engine reads: the name a request carries, and the placeholder rules the lexer
//! applies, which are settled before any database's parser runs. Each dialect is read by its own
//! database's engine: Postgres with its own grammar (`engine/syntax`), SQLite through SQLite's own resolved tree, MySQL
//! from the server's prepare metadata and a `sqlparser` tree.

use crate::lex::Target;
use serde::{Deserialize, Serialize};

#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
#[serde(rename_all = "lowercase")]
pub enum Dialect {
    Postgres,
    Sqlite,
    Mysql,
}

impl Dialect {
    pub fn name(self) -> &'static str {
        match self {
            Dialect::Postgres => "postgres",
            Dialect::Sqlite => "sqlite",
            Dialect::Mysql => "mysql",
        }
    }

    /// The placeholder form an analysis hands the statement back in, the one the driver binds.
    pub fn binds(self) -> Target {
        match self {
            Dialect::Postgres => Target::Dollar,
            Dialect::Sqlite | Dialect::Mysql => Target::Question,
        }
    }
}