sqlparser/dialect/
oracle.rs1use log::debug;
19
20use crate::{
21 parser::{Parser, ParserError},
22 tokenizer::Token,
23};
24
25use super::{Dialect, Precedence};
26
27#[derive(Debug)]
29pub struct OracleDialect;
30
31impl Dialect for OracleDialect {
32 fn identifier_quote_style(&self, _identifier: &str) -> Option<char> {
34 Some('"')
35 }
36
37 fn is_delimited_identifier_start(&self, ch: char) -> bool {
38 ch == '"'
39 }
40
41 fn is_identifier_start(&self, ch: char) -> bool {
42 ch.is_alphabetic()
43 }
44
45 fn is_identifier_part(&self, ch: char) -> bool {
46 ch.is_alphanumeric() || ch == '_' || ch == '$' || ch == '#' || ch == '@'
47 }
48
49 fn supports_outer_join_operator(&self) -> bool {
50 true
51 }
52
53 fn supports_connect_by(&self) -> bool {
54 true
55 }
56
57 fn supports_execute_immediate(&self) -> bool {
58 true
59 }
60
61 fn supports_match_recognize(&self) -> bool {
62 true
63 }
64
65 fn supports_window_function_null_treatment_arg(&self) -> bool {
66 true
67 }
68
69 fn supports_boolean_literals(&self) -> bool {
70 false
71 }
72
73 fn supports_comment_on(&self) -> bool {
74 true
75 }
76
77 fn supports_create_table_select(&self) -> bool {
78 true
79 }
80
81 fn supports_set_stmt_without_operator(&self) -> bool {
82 true
83 }
84
85 fn get_next_precedence(&self, parser: &Parser) -> Option<Result<u8, ParserError>> {
86 let t = parser.peek_token();
87 debug!("get_next_precedence() {t:?}");
88
89 match t.token {
90 Token::StringConcat => Some(Ok(self.prec_value(Precedence::PlusMinus))),
91 _ => None,
92 }
93 }
94
95 fn supports_group_by_expr(&self) -> bool {
96 true
97 }
98
99 fn supports_quote_delimited_string(&self) -> bool {
100 true
101 }
102}