qail_core/transpiler/dialect.rs
1use crate::transpiler::sql::postgres::PostgresGenerator;
2use crate::transpiler::traits::SqlGenerator;
3
4/// SQL dialect selection for transpilation.
5///
6/// PostgreSQL is the only SQL target. The enum is kept so
7/// `to_sql_with_dialect` remains a stable call shape; the 1.x `SQLite`
8/// variant was removed in 2.0.
9#[derive(Debug, Clone, Copy, PartialEq, Eq, Default)]
10pub enum Dialect {
11 /// PostgreSQL dialect.
12 #[default]
13 Postgres,
14}
15
16impl Dialect {
17 /// Create the dialect-specific SQL generator.
18 pub fn generator(&self) -> Box<dyn SqlGenerator> {
19 match self {
20 Dialect::Postgres => Box::new(PostgresGenerator),
21 }
22 }
23}