sqlparser/dialect/oracle.rs
1// Licensed to the Apache Software Foundation (ASF) under one
2// or more contributor license agreements. See the NOTICE file
3// distributed with this work for additional information
4// regarding copyright ownership. The ASF licenses this file
5// to you under the Apache License, Version 2.0 (the
6// "License"); you may not use this file except in compliance
7// with the License. You may obtain a copy of the License at
8//
9// http://www.apache.org/licenses/LICENSE-2.0
10//
11// Unless required by applicable law or agreed to in writing,
12// software distributed under the License is distributed on an
13// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14// KIND, either express or implied. See the License for the
15// specific language governing permissions and limitations
16// under the License.
17
18use super::Dialect;
19
20/// A [`Dialect`] for [Oracle Databases](https://docs.oracle.com/en/database/oracle/oracle-database/21/sqlrf/index.html)
21#[derive(Debug)]
22pub struct OracleDialect;
23
24impl Dialect for OracleDialect {
25 // ~ appears not to be called anywhere
26 fn identifier_quote_style(&self, _identifier: &str) -> Option<char> {
27 Some('"')
28 }
29
30 fn is_delimited_identifier_start(&self, ch: char) -> bool {
31 ch == '"'
32 }
33
34 fn is_identifier_start(&self, ch: char) -> bool {
35 ch.is_alphabetic()
36 }
37
38 fn is_identifier_part(&self, ch: char) -> bool {
39 ch.is_alphanumeric() || ch == '_' || ch == '$' || ch == '#' || ch == '@'
40 }
41
42 fn supports_outer_join_operator(&self) -> bool {
43 true
44 }
45
46 fn supports_connect_by(&self) -> bool {
47 true
48 }
49
50 fn supports_execute_immediate(&self) -> bool {
51 true
52 }
53
54 fn supports_match_recognize(&self) -> bool {
55 true
56 }
57
58 fn supports_window_function_null_treatment_arg(&self) -> bool {
59 true
60 }
61
62 fn supports_boolean_literals(&self) -> bool {
63 false
64 }
65
66 fn supports_comment_on(&self) -> bool {
67 true
68 }
69
70 fn supports_create_table_select(&self) -> bool {
71 true
72 }
73
74 fn supports_set_stmt_without_operator(&self) -> bool {
75 true
76 }
77
78 fn supports_group_by_expr(&self) -> bool {
79 true
80 }
81}