querydown/dialects/
dialect.rs1use crate::syntax_tree::{Date, Duration};
2
3pub trait Dialect {
4 fn quote_identifier(&self, ident: &str) -> String;
6
7 fn quote_string(&self, string: &str) -> String;
9
10 fn date(&self, date: &Date) -> String;
12
13 fn duration(&self, duration: &Duration) -> String;
15
16 fn table_column(&self, table: &str, column: &str) -> String {
18 let quoted_table = self.quote_identifier(table);
19 let quoted_column = self.quote_identifier(column);
20 format!("{}.{}", quoted_table, quoted_column)
21 }
22}