1use crate::{ast::SqlRoot, kind::SqlSyntaxKind};
2use oak_core::Language;
3
4#[derive(Debug, Clone, Copy, PartialEq, Eq)]
6pub struct SqlLanguage {
7 pub case_sensitive: bool,
9 pub quoted_identifiers: bool,
11 pub backtick_identifiers: bool,
13 pub bracket_identifiers: bool,
15}
16
17impl SqlLanguage {
18 pub fn standard() -> Self {
20 Self::default()
21 }
22
23 pub fn mysql() -> Self {
25 Self { case_sensitive: false, quoted_identifiers: true, backtick_identifiers: true, bracket_identifiers: false }
26 }
27
28 pub fn postgresql() -> Self {
30 Self { case_sensitive: false, quoted_identifiers: true, backtick_identifiers: false, bracket_identifiers: false }
31 }
32
33 pub fn sqlserver() -> Self {
35 Self { case_sensitive: false, quoted_identifiers: true, backtick_identifiers: false, bracket_identifiers: true }
36 }
37}
38
39impl Default for SqlLanguage {
40 fn default() -> Self {
41 Self { case_sensitive: false, quoted_identifiers: true, backtick_identifiers: false, bracket_identifiers: false }
42 }
43}
44
45impl Language for SqlLanguage {
46 type SyntaxKind = SqlSyntaxKind;
47 type TypedRoot = SqlRoot;
48}