sqlglot.dialects.oracle
1from __future__ import annotations 2 3import typing as t 4 5from sqlglot import exp, generator, parser, tokens, transforms 6from sqlglot.dialects.dialect import Dialect, no_ilike_sql, rename_func, trim_sql 7from sqlglot.helper import seq_get 8from sqlglot.tokens import TokenType 9 10 11def _parse_xml_table(self) -> exp.XMLTable: 12 this = self._parse_string() 13 14 passing = None 15 columns = None 16 17 if self._match_text_seq("PASSING"): 18 # The BY VALUE keywords are optional and are provided for semantic clarity 19 self._match_text_seq("BY", "VALUE") 20 passing = self._parse_csv(self._parse_column) 21 22 by_ref = self._match_text_seq("RETURNING", "SEQUENCE", "BY", "REF") 23 24 if self._match_text_seq("COLUMNS"): 25 columns = self._parse_csv(lambda: self._parse_column_def(self._parse_field(any_token=True))) 26 27 return self.expression( 28 exp.XMLTable, 29 this=this, 30 passing=passing, 31 columns=columns, 32 by_ref=by_ref, 33 ) 34 35 36class Oracle(Dialect): 37 # https://docs.oracle.com/database/121/SQLRF/sql_elements004.htm#SQLRF00212 38 # https://docs.python.org/3/library/datetime.html#strftime-and-strptime-format-codes 39 time_mapping = { 40 "AM": "%p", # Meridian indicator with or without periods 41 "A.M.": "%p", # Meridian indicator with or without periods 42 "PM": "%p", # Meridian indicator with or without periods 43 "P.M.": "%p", # Meridian indicator with or without periods 44 "D": "%u", # Day of week (1-7) 45 "DAY": "%A", # name of day 46 "DD": "%d", # day of month (1-31) 47 "DDD": "%j", # day of year (1-366) 48 "DY": "%a", # abbreviated name of day 49 "HH": "%I", # Hour of day (1-12) 50 "HH12": "%I", # alias for HH 51 "HH24": "%H", # Hour of day (0-23) 52 "IW": "%V", # Calendar week of year (1-52 or 1-53), as defined by the ISO 8601 standard 53 "MI": "%M", # Minute (0-59) 54 "MM": "%m", # Month (01-12; January = 01) 55 "MON": "%b", # Abbreviated name of month 56 "MONTH": "%B", # Name of month 57 "SS": "%S", # Second (0-59) 58 "WW": "%W", # Week of year (1-53) 59 "YY": "%y", # 15 60 "YYYY": "%Y", # 2015 61 } 62 63 class Parser(parser.Parser): 64 FUNCTIONS = { 65 **parser.Parser.FUNCTIONS, # type: ignore 66 "SQUARE": lambda args: exp.Pow(this=seq_get(args, 0), expression=exp.Literal.number(2)), 67 } 68 69 FUNCTION_PARSERS: t.Dict[str, t.Callable] = { 70 **parser.Parser.FUNCTION_PARSERS, 71 "XMLTABLE": _parse_xml_table, 72 } 73 74 TYPE_LITERAL_PARSERS = { 75 exp.DataType.Type.DATE: lambda self, this, _: self.expression( 76 exp.DateStrToDate, this=this 77 ) 78 } 79 80 def _parse_column(self) -> t.Optional[exp.Expression]: 81 column = super()._parse_column() 82 if column: 83 column.set("join_mark", self._match(TokenType.JOIN_MARKER)) 84 return column 85 86 def _parse_hint(self) -> t.Optional[exp.Expression]: 87 if self._match(TokenType.HINT): 88 start = self._curr 89 while self._curr and not self._match_pair(TokenType.STAR, TokenType.SLASH): 90 self._advance() 91 92 if not self._curr: 93 self.raise_error("Expected */ after HINT") 94 95 end = self._tokens[self._index - 3] 96 return exp.Hint(expressions=[self._find_sql(start, end)]) 97 98 return None 99 100 class Generator(generator.Generator): 101 LOCKING_READS_SUPPORTED = True 102 JOIN_HINTS = False 103 TABLE_HINTS = False 104 105 TYPE_MAPPING = { 106 **generator.Generator.TYPE_MAPPING, # type: ignore 107 exp.DataType.Type.TINYINT: "NUMBER", 108 exp.DataType.Type.SMALLINT: "NUMBER", 109 exp.DataType.Type.INT: "NUMBER", 110 exp.DataType.Type.BIGINT: "NUMBER", 111 exp.DataType.Type.DECIMAL: "NUMBER", 112 exp.DataType.Type.DOUBLE: "DOUBLE PRECISION", 113 exp.DataType.Type.VARCHAR: "VARCHAR2", 114 exp.DataType.Type.NVARCHAR: "NVARCHAR2", 115 exp.DataType.Type.TEXT: "CLOB", 116 exp.DataType.Type.BINARY: "BLOB", 117 exp.DataType.Type.VARBINARY: "BLOB", 118 } 119 120 TRANSFORMS = { 121 **generator.Generator.TRANSFORMS, # type: ignore 122 **transforms.UNALIAS_GROUP, # type: ignore 123 exp.DateStrToDate: lambda self, e: self.func( 124 "TO_DATE", e.this, exp.Literal.string("YYYY-MM-DD") 125 ), 126 exp.Hint: lambda self, e: f" /*+ {self.expressions(e).strip()} */", 127 exp.ILike: no_ilike_sql, 128 exp.StrToTime: lambda self, e: f"TO_TIMESTAMP({self.sql(e, 'this')}, {self.format_time(e)})", 129 exp.Subquery: lambda self, e: self.subquery_sql(e, sep=" "), 130 exp.Substring: rename_func("SUBSTR"), 131 exp.Table: lambda self, e: self.table_sql(e, sep=" "), 132 exp.TimeToStr: lambda self, e: f"TO_CHAR({self.sql(e, 'this')}, {self.format_time(e)})", 133 exp.ToChar: lambda self, e: self.function_fallback_sql(e), 134 exp.Trim: trim_sql, 135 exp.UnixToTime: lambda self, e: f"TO_DATE('1970-01-01','YYYY-MM-DD') + ({self.sql(e, 'this')} / 86400)", 136 exp.IfNull: rename_func("NVL"), 137 } 138 139 PROPERTIES_LOCATION = { 140 **generator.Generator.PROPERTIES_LOCATION, # type: ignore 141 exp.VolatileProperty: exp.Properties.Location.UNSUPPORTED, 142 } 143 144 LIMIT_FETCH = "FETCH" 145 146 def offset_sql(self, expression: exp.Offset) -> str: 147 return f"{super().offset_sql(expression)} ROWS" 148 149 def column_sql(self, expression: exp.Column) -> str: 150 column = super().column_sql(expression) 151 return f"{column} (+)" if expression.args.get("join_mark") else column 152 153 def xmltable_sql(self, expression: exp.XMLTable) -> str: 154 this = self.sql(expression, "this") 155 passing = self.expressions(expression, key="passing") 156 passing = f"{self.sep()}PASSING{self.seg(passing)}" if passing else "" 157 columns = self.expressions(expression, key="columns") 158 columns = f"{self.sep()}COLUMNS{self.seg(columns)}" if columns else "" 159 by_ref = ( 160 f"{self.sep()}RETURNING SEQUENCE BY REF" if expression.args.get("by_ref") else "" 161 ) 162 return f"XMLTABLE({self.sep('')}{self.indent(this + passing + by_ref + columns)}{self.seg(')', sep='')}" 163 164 class Tokenizer(tokens.Tokenizer): 165 KEYWORDS = { 166 **tokens.Tokenizer.KEYWORDS, 167 "(+)": TokenType.JOIN_MARKER, 168 "COLUMNS": TokenType.COLUMN, 169 "MATCH_RECOGNIZE": TokenType.MATCH_RECOGNIZE, 170 "MINUS": TokenType.EXCEPT, 171 "NVARCHAR2": TokenType.NVARCHAR, 172 "RETURNING": TokenType.RETURNING, 173 "START": TokenType.BEGIN, 174 "TOP": TokenType.TOP, 175 "VARCHAR2": TokenType.VARCHAR, 176 }
37class Oracle(Dialect): 38 # https://docs.oracle.com/database/121/SQLRF/sql_elements004.htm#SQLRF00212 39 # https://docs.python.org/3/library/datetime.html#strftime-and-strptime-format-codes 40 time_mapping = { 41 "AM": "%p", # Meridian indicator with or without periods 42 "A.M.": "%p", # Meridian indicator with or without periods 43 "PM": "%p", # Meridian indicator with or without periods 44 "P.M.": "%p", # Meridian indicator with or without periods 45 "D": "%u", # Day of week (1-7) 46 "DAY": "%A", # name of day 47 "DD": "%d", # day of month (1-31) 48 "DDD": "%j", # day of year (1-366) 49 "DY": "%a", # abbreviated name of day 50 "HH": "%I", # Hour of day (1-12) 51 "HH12": "%I", # alias for HH 52 "HH24": "%H", # Hour of day (0-23) 53 "IW": "%V", # Calendar week of year (1-52 or 1-53), as defined by the ISO 8601 standard 54 "MI": "%M", # Minute (0-59) 55 "MM": "%m", # Month (01-12; January = 01) 56 "MON": "%b", # Abbreviated name of month 57 "MONTH": "%B", # Name of month 58 "SS": "%S", # Second (0-59) 59 "WW": "%W", # Week of year (1-53) 60 "YY": "%y", # 15 61 "YYYY": "%Y", # 2015 62 } 63 64 class Parser(parser.Parser): 65 FUNCTIONS = { 66 **parser.Parser.FUNCTIONS, # type: ignore 67 "SQUARE": lambda args: exp.Pow(this=seq_get(args, 0), expression=exp.Literal.number(2)), 68 } 69 70 FUNCTION_PARSERS: t.Dict[str, t.Callable] = { 71 **parser.Parser.FUNCTION_PARSERS, 72 "XMLTABLE": _parse_xml_table, 73 } 74 75 TYPE_LITERAL_PARSERS = { 76 exp.DataType.Type.DATE: lambda self, this, _: self.expression( 77 exp.DateStrToDate, this=this 78 ) 79 } 80 81 def _parse_column(self) -> t.Optional[exp.Expression]: 82 column = super()._parse_column() 83 if column: 84 column.set("join_mark", self._match(TokenType.JOIN_MARKER)) 85 return column 86 87 def _parse_hint(self) -> t.Optional[exp.Expression]: 88 if self._match(TokenType.HINT): 89 start = self._curr 90 while self._curr and not self._match_pair(TokenType.STAR, TokenType.SLASH): 91 self._advance() 92 93 if not self._curr: 94 self.raise_error("Expected */ after HINT") 95 96 end = self._tokens[self._index - 3] 97 return exp.Hint(expressions=[self._find_sql(start, end)]) 98 99 return None 100 101 class Generator(generator.Generator): 102 LOCKING_READS_SUPPORTED = True 103 JOIN_HINTS = False 104 TABLE_HINTS = False 105 106 TYPE_MAPPING = { 107 **generator.Generator.TYPE_MAPPING, # type: ignore 108 exp.DataType.Type.TINYINT: "NUMBER", 109 exp.DataType.Type.SMALLINT: "NUMBER", 110 exp.DataType.Type.INT: "NUMBER", 111 exp.DataType.Type.BIGINT: "NUMBER", 112 exp.DataType.Type.DECIMAL: "NUMBER", 113 exp.DataType.Type.DOUBLE: "DOUBLE PRECISION", 114 exp.DataType.Type.VARCHAR: "VARCHAR2", 115 exp.DataType.Type.NVARCHAR: "NVARCHAR2", 116 exp.DataType.Type.TEXT: "CLOB", 117 exp.DataType.Type.BINARY: "BLOB", 118 exp.DataType.Type.VARBINARY: "BLOB", 119 } 120 121 TRANSFORMS = { 122 **generator.Generator.TRANSFORMS, # type: ignore 123 **transforms.UNALIAS_GROUP, # type: ignore 124 exp.DateStrToDate: lambda self, e: self.func( 125 "TO_DATE", e.this, exp.Literal.string("YYYY-MM-DD") 126 ), 127 exp.Hint: lambda self, e: f" /*+ {self.expressions(e).strip()} */", 128 exp.ILike: no_ilike_sql, 129 exp.StrToTime: lambda self, e: f"TO_TIMESTAMP({self.sql(e, 'this')}, {self.format_time(e)})", 130 exp.Subquery: lambda self, e: self.subquery_sql(e, sep=" "), 131 exp.Substring: rename_func("SUBSTR"), 132 exp.Table: lambda self, e: self.table_sql(e, sep=" "), 133 exp.TimeToStr: lambda self, e: f"TO_CHAR({self.sql(e, 'this')}, {self.format_time(e)})", 134 exp.ToChar: lambda self, e: self.function_fallback_sql(e), 135 exp.Trim: trim_sql, 136 exp.UnixToTime: lambda self, e: f"TO_DATE('1970-01-01','YYYY-MM-DD') + ({self.sql(e, 'this')} / 86400)", 137 exp.IfNull: rename_func("NVL"), 138 } 139 140 PROPERTIES_LOCATION = { 141 **generator.Generator.PROPERTIES_LOCATION, # type: ignore 142 exp.VolatileProperty: exp.Properties.Location.UNSUPPORTED, 143 } 144 145 LIMIT_FETCH = "FETCH" 146 147 def offset_sql(self, expression: exp.Offset) -> str: 148 return f"{super().offset_sql(expression)} ROWS" 149 150 def column_sql(self, expression: exp.Column) -> str: 151 column = super().column_sql(expression) 152 return f"{column} (+)" if expression.args.get("join_mark") else column 153 154 def xmltable_sql(self, expression: exp.XMLTable) -> str: 155 this = self.sql(expression, "this") 156 passing = self.expressions(expression, key="passing") 157 passing = f"{self.sep()}PASSING{self.seg(passing)}" if passing else "" 158 columns = self.expressions(expression, key="columns") 159 columns = f"{self.sep()}COLUMNS{self.seg(columns)}" if columns else "" 160 by_ref = ( 161 f"{self.sep()}RETURNING SEQUENCE BY REF" if expression.args.get("by_ref") else "" 162 ) 163 return f"XMLTABLE({self.sep('')}{self.indent(this + passing + by_ref + columns)}{self.seg(')', sep='')}" 164 165 class Tokenizer(tokens.Tokenizer): 166 KEYWORDS = { 167 **tokens.Tokenizer.KEYWORDS, 168 "(+)": TokenType.JOIN_MARKER, 169 "COLUMNS": TokenType.COLUMN, 170 "MATCH_RECOGNIZE": TokenType.MATCH_RECOGNIZE, 171 "MINUS": TokenType.EXCEPT, 172 "NVARCHAR2": TokenType.NVARCHAR, 173 "RETURNING": TokenType.RETURNING, 174 "START": TokenType.BEGIN, 175 "TOP": TokenType.TOP, 176 "VARCHAR2": TokenType.VARCHAR, 177 }
64 class Parser(parser.Parser): 65 FUNCTIONS = { 66 **parser.Parser.FUNCTIONS, # type: ignore 67 "SQUARE": lambda args: exp.Pow(this=seq_get(args, 0), expression=exp.Literal.number(2)), 68 } 69 70 FUNCTION_PARSERS: t.Dict[str, t.Callable] = { 71 **parser.Parser.FUNCTION_PARSERS, 72 "XMLTABLE": _parse_xml_table, 73 } 74 75 TYPE_LITERAL_PARSERS = { 76 exp.DataType.Type.DATE: lambda self, this, _: self.expression( 77 exp.DateStrToDate, this=this 78 ) 79 } 80 81 def _parse_column(self) -> t.Optional[exp.Expression]: 82 column = super()._parse_column() 83 if column: 84 column.set("join_mark", self._match(TokenType.JOIN_MARKER)) 85 return column 86 87 def _parse_hint(self) -> t.Optional[exp.Expression]: 88 if self._match(TokenType.HINT): 89 start = self._curr 90 while self._curr and not self._match_pair(TokenType.STAR, TokenType.SLASH): 91 self._advance() 92 93 if not self._curr: 94 self.raise_error("Expected */ after HINT") 95 96 end = self._tokens[self._index - 3] 97 return exp.Hint(expressions=[self._find_sql(start, end)]) 98 99 return None
Parser consumes a list of tokens produced by the sqlglot.tokens.Tokenizer
and produces
a parsed syntax tree.
Arguments:
- error_level: the desired error level. Default: ErrorLevel.RAISE
- error_message_context: determines the amount of context to capture from a query string when displaying the error message (in number of characters). Default: 50.
- index_offset: Index offset for arrays eg ARRAY[0] vs ARRAY[1] as the head of a list. Default: 0
- alias_post_tablesample: If the table alias comes after tablesample. Default: False
- max_errors: Maximum number of error messages to include in a raised ParseError. This is only relevant if error_level is ErrorLevel.RAISE. Default: 3
- null_ordering: Indicates the default null ordering method to use if not explicitly set. Options are "nulls_are_small", "nulls_are_large", "nulls_are_last". Default: "nulls_are_small"
Inherited Members
101 class Generator(generator.Generator): 102 LOCKING_READS_SUPPORTED = True 103 JOIN_HINTS = False 104 TABLE_HINTS = False 105 106 TYPE_MAPPING = { 107 **generator.Generator.TYPE_MAPPING, # type: ignore 108 exp.DataType.Type.TINYINT: "NUMBER", 109 exp.DataType.Type.SMALLINT: "NUMBER", 110 exp.DataType.Type.INT: "NUMBER", 111 exp.DataType.Type.BIGINT: "NUMBER", 112 exp.DataType.Type.DECIMAL: "NUMBER", 113 exp.DataType.Type.DOUBLE: "DOUBLE PRECISION", 114 exp.DataType.Type.VARCHAR: "VARCHAR2", 115 exp.DataType.Type.NVARCHAR: "NVARCHAR2", 116 exp.DataType.Type.TEXT: "CLOB", 117 exp.DataType.Type.BINARY: "BLOB", 118 exp.DataType.Type.VARBINARY: "BLOB", 119 } 120 121 TRANSFORMS = { 122 **generator.Generator.TRANSFORMS, # type: ignore 123 **transforms.UNALIAS_GROUP, # type: ignore 124 exp.DateStrToDate: lambda self, e: self.func( 125 "TO_DATE", e.this, exp.Literal.string("YYYY-MM-DD") 126 ), 127 exp.Hint: lambda self, e: f" /*+ {self.expressions(e).strip()} */", 128 exp.ILike: no_ilike_sql, 129 exp.StrToTime: lambda self, e: f"TO_TIMESTAMP({self.sql(e, 'this')}, {self.format_time(e)})", 130 exp.Subquery: lambda self, e: self.subquery_sql(e, sep=" "), 131 exp.Substring: rename_func("SUBSTR"), 132 exp.Table: lambda self, e: self.table_sql(e, sep=" "), 133 exp.TimeToStr: lambda self, e: f"TO_CHAR({self.sql(e, 'this')}, {self.format_time(e)})", 134 exp.ToChar: lambda self, e: self.function_fallback_sql(e), 135 exp.Trim: trim_sql, 136 exp.UnixToTime: lambda self, e: f"TO_DATE('1970-01-01','YYYY-MM-DD') + ({self.sql(e, 'this')} / 86400)", 137 exp.IfNull: rename_func("NVL"), 138 } 139 140 PROPERTIES_LOCATION = { 141 **generator.Generator.PROPERTIES_LOCATION, # type: ignore 142 exp.VolatileProperty: exp.Properties.Location.UNSUPPORTED, 143 } 144 145 LIMIT_FETCH = "FETCH" 146 147 def offset_sql(self, expression: exp.Offset) -> str: 148 return f"{super().offset_sql(expression)} ROWS" 149 150 def column_sql(self, expression: exp.Column) -> str: 151 column = super().column_sql(expression) 152 return f"{column} (+)" if expression.args.get("join_mark") else column 153 154 def xmltable_sql(self, expression: exp.XMLTable) -> str: 155 this = self.sql(expression, "this") 156 passing = self.expressions(expression, key="passing") 157 passing = f"{self.sep()}PASSING{self.seg(passing)}" if passing else "" 158 columns = self.expressions(expression, key="columns") 159 columns = f"{self.sep()}COLUMNS{self.seg(columns)}" if columns else "" 160 by_ref = ( 161 f"{self.sep()}RETURNING SEQUENCE BY REF" if expression.args.get("by_ref") else "" 162 ) 163 return f"XMLTABLE({self.sep('')}{self.indent(this + passing + by_ref + columns)}{self.seg(')', sep='')}"
Generator interprets the given syntax tree and produces a SQL string as an output.
Arguments:
- time_mapping (dict): the dictionary of custom time mappings in which the key represents a python time format and the output the target time format
- time_trie (trie): a trie of the time_mapping keys
- pretty (bool): if set to True the returned string will be formatted. Default: False.
- quote_start (str): specifies which starting character to use to delimit quotes. Default: '.
- quote_end (str): specifies which ending character to use to delimit quotes. Default: '.
- identifier_start (str): specifies which starting character to use to delimit identifiers. Default: ".
- identifier_end (str): specifies which ending character to use to delimit identifiers. Default: ".
- identify (bool | str): 'always': always quote, 'safe': quote identifiers if they don't contain an upcase, True defaults to always.
- normalize (bool): if set to True all identifiers will lower cased
- string_escape (str): specifies a string escape character. Default: '.
- identifier_escape (str): specifies an identifier escape character. Default: ".
- pad (int): determines padding in a formatted string. Default: 2.
- indent (int): determines the size of indentation in a formatted string. Default: 4.
- unnest_column_only (bool): if true unnest table aliases are considered only as column aliases
- normalize_functions (str): normalize function names, "upper", "lower", or None Default: "upper"
- alias_post_tablesample (bool): if the table alias comes after tablesample Default: False
- unsupported_level (ErrorLevel): determines the generator's behavior when it encounters unsupported expressions. Default ErrorLevel.WARN.
- null_ordering (str): Indicates the default null ordering method to use if not explicitly set. Options are "nulls_are_small", "nulls_are_large", "nulls_are_last". Default: "nulls_are_small"
- max_unsupported (int): Maximum number of unsupported messages to include in a raised UnsupportedError. This is only relevant if unsupported_level is ErrorLevel.RAISE. Default: 3
- leading_comma (bool): if the the comma is leading or trailing in select statements Default: False
- max_text_width: The max number of characters in a segment before creating new lines in pretty mode. The default is on the smaller end because the length only represents a segment and not the true line length. Default: 80
- comments: Whether or not to preserve comments in the output SQL code. Default: True
154 def xmltable_sql(self, expression: exp.XMLTable) -> str: 155 this = self.sql(expression, "this") 156 passing = self.expressions(expression, key="passing") 157 passing = f"{self.sep()}PASSING{self.seg(passing)}" if passing else "" 158 columns = self.expressions(expression, key="columns") 159 columns = f"{self.sep()}COLUMNS{self.seg(columns)}" if columns else "" 160 by_ref = ( 161 f"{self.sep()}RETURNING SEQUENCE BY REF" if expression.args.get("by_ref") else "" 162 ) 163 return f"XMLTABLE({self.sep('')}{self.indent(this + passing + by_ref + columns)}{self.seg(')', sep='')}"
Inherited Members
- sqlglot.generator.Generator
- Generator
- generate
- unsupported
- sep
- seg
- pad_comment
- maybe_comment
- wrap
- no_identify
- normalize_func
- indent
- sql
- uncache_sql
- cache_sql
- characterset_sql
- columnposition_sql
- columndef_sql
- columnconstraint_sql
- autoincrementcolumnconstraint_sql
- compresscolumnconstraint_sql
- generatedasidentitycolumnconstraint_sql
- notnullcolumnconstraint_sql
- primarykeycolumnconstraint_sql
- uniquecolumnconstraint_sql
- create_sql
- describe_sql
- prepend_ctes
- with_sql
- cte_sql
- tablealias_sql
- bitstring_sql
- hexstring_sql
- bytestring_sql
- datatype_sql
- directory_sql
- delete_sql
- drop_sql
- except_sql
- except_op
- fetch_sql
- filter_sql
- hint_sql
- index_sql
- identifier_sql
- inputoutputformat_sql
- national_sql
- partition_sql
- properties_sql
- root_properties
- properties
- with_properties
- locate_properties
- property_sql
- likeproperty_sql
- fallbackproperty_sql
- journalproperty_sql
- freespaceproperty_sql
- afterjournalproperty_sql
- checksumproperty_sql
- mergeblockratioproperty_sql
- datablocksizeproperty_sql
- blockcompressionproperty_sql
- isolatedloadingproperty_sql
- lockingproperty_sql
- withdataproperty_sql
- insert_sql
- intersect_sql
- intersect_op
- introducer_sql
- pseudotype_sql
- onconflict_sql
- returning_sql
- rowformatdelimitedproperty_sql
- table_sql
- tablesample_sql
- pivot_sql
- tuple_sql
- update_sql
- values_sql
- var_sql
- into_sql
- from_sql
- group_sql
- having_sql
- join_sql
- lambda_sql
- lateral_sql
- limit_sql
- setitem_sql
- set_sql
- pragma_sql
- lock_sql
- literal_sql
- loaddata_sql
- null_sql
- boolean_sql
- order_sql
- cluster_sql
- distribute_sql
- sort_sql
- ordered_sql
- matchrecognize_sql
- query_modifiers
- select_sql
- schema_sql
- star_sql
- structkwarg_sql
- parameter_sql
- sessionparameter_sql
- placeholder_sql
- subquery_sql
- qualify_sql
- union_sql
- union_op
- unnest_sql
- where_sql
- window_sql
- partition_by_sql
- window_spec_sql
- withingroup_sql
- between_sql
- bracket_sql
- all_sql
- any_sql
- exists_sql
- case_sql
- constraint_sql
- extract_sql
- trim_sql
- concat_sql
- check_sql
- foreignkey_sql
- primarykey_sql
- unique_sql
- if_sql
- matchagainst_sql
- jsonkeyvalue_sql
- jsonobject_sql
- in_sql
- in_unnest_op
- interval_sql
- return_sql
- reference_sql
- anonymous_sql
- paren_sql
- neg_sql
- not_sql
- alias_sql
- aliases_sql
- attimezone_sql
- add_sql
- and_sql
- connector_sql
- bitwiseand_sql
- bitwiseleftshift_sql
- bitwisenot_sql
- bitwiseor_sql
- bitwiserightshift_sql
- bitwisexor_sql
- cast_sql
- currentdate_sql
- collate_sql
- command_sql
- comment_sql
- transaction_sql
- commit_sql
- rollback_sql
- altercolumn_sql
- renametable_sql
- altertable_sql
- droppartition_sql
- addconstraint_sql
- distinct_sql
- ignorenulls_sql
- respectnulls_sql
- intdiv_sql
- dpipe_sql
- div_sql
- overlaps_sql
- distance_sql
- dot_sql
- eq_sql
- escape_sql
- glob_sql
- gt_sql
- gte_sql
- ilike_sql
- ilikeany_sql
- is_sql
- like_sql
- likeany_sql
- similarto_sql
- lt_sql
- lte_sql
- mod_sql
- mul_sql
- neq_sql
- nullsafeeq_sql
- nullsafeneq_sql
- or_sql
- slice_sql
- sub_sql
- trycast_sql
- use_sql
- binary
- function_fallback_sql
- func
- format_args
- text_width
- format_time
- expressions
- op_expressions
- naked_property
- set_operation
- tag_sql
- token_sql
- userdefinedfunction_sql
- joinhint_sql
- kwarg_sql
- when_sql
- merge_sql
- tochar_sql
165 class Tokenizer(tokens.Tokenizer): 166 KEYWORDS = { 167 **tokens.Tokenizer.KEYWORDS, 168 "(+)": TokenType.JOIN_MARKER, 169 "COLUMNS": TokenType.COLUMN, 170 "MATCH_RECOGNIZE": TokenType.MATCH_RECOGNIZE, 171 "MINUS": TokenType.EXCEPT, 172 "NVARCHAR2": TokenType.NVARCHAR, 173 "RETURNING": TokenType.RETURNING, 174 "START": TokenType.BEGIN, 175 "TOP": TokenType.TOP, 176 "VARCHAR2": TokenType.VARCHAR, 177 }