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 10PASSING_TABLE_ALIAS_TOKENS = parser.Parser.TABLE_ALIAS_TOKENS - { 11 TokenType.COLUMN, 12 TokenType.RETURNING, 13} 14 15 16def _parse_xml_table(self) -> exp.XMLTable: 17 this = self._parse_string() 18 19 passing = None 20 columns = None 21 22 if self._match_text_seq("PASSING"): 23 # The BY VALUE keywords are optional and are provided for semantic clarity 24 self._match_text_seq("BY", "VALUE") 25 passing = self._parse_csv( 26 lambda: self._parse_table(alias_tokens=PASSING_TABLE_ALIAS_TOKENS) 27 ) 28 29 by_ref = self._match_text_seq("RETURNING", "SEQUENCE", "BY", "REF") 30 31 if self._match_text_seq("COLUMNS"): 32 columns = self._parse_csv(lambda: self._parse_column_def(self._parse_field(any_token=True))) 33 34 return self.expression( 35 exp.XMLTable, 36 this=this, 37 passing=passing, 38 columns=columns, 39 by_ref=by_ref, 40 ) 41 42 43class Oracle(Dialect): 44 # https://docs.oracle.com/database/121/SQLRF/sql_elements004.htm#SQLRF00212 45 # https://docs.python.org/3/library/datetime.html#strftime-and-strptime-format-codes 46 time_mapping = { 47 "AM": "%p", # Meridian indicator with or without periods 48 "A.M.": "%p", # Meridian indicator with or without periods 49 "PM": "%p", # Meridian indicator with or without periods 50 "P.M.": "%p", # Meridian indicator with or without periods 51 "D": "%u", # Day of week (1-7) 52 "DAY": "%A", # name of day 53 "DD": "%d", # day of month (1-31) 54 "DDD": "%j", # day of year (1-366) 55 "DY": "%a", # abbreviated name of day 56 "HH": "%I", # Hour of day (1-12) 57 "HH12": "%I", # alias for HH 58 "HH24": "%H", # Hour of day (0-23) 59 "IW": "%V", # Calendar week of year (1-52 or 1-53), as defined by the ISO 8601 standard 60 "MI": "%M", # Minute (0-59) 61 "MM": "%m", # Month (01-12; January = 01) 62 "MON": "%b", # Abbreviated name of month 63 "MONTH": "%B", # Name of month 64 "SS": "%S", # Second (0-59) 65 "WW": "%W", # Week of year (1-53) 66 "YY": "%y", # 15 67 "YYYY": "%Y", # 2015 68 } 69 70 class Parser(parser.Parser): 71 FUNCTIONS = { 72 **parser.Parser.FUNCTIONS, # type: ignore 73 "DECODE": exp.Matches.from_arg_list, 74 "SQUARE": lambda args: exp.Pow(this=seq_get(args, 0), expression=exp.Literal.number(2)), 75 } 76 77 FUNCTION_PARSERS: t.Dict[str, t.Callable] = { 78 **parser.Parser.FUNCTION_PARSERS, 79 "XMLTABLE": _parse_xml_table, 80 } 81 82 def _parse_column(self) -> t.Optional[exp.Expression]: 83 column = super()._parse_column() 84 if column: 85 column.set("join_mark", self._match(TokenType.JOIN_MARKER)) 86 return column 87 88 def _parse_hint(self) -> t.Optional[exp.Expression]: 89 if self._match(TokenType.HINT): 90 start = self._curr 91 while self._curr and not self._match_pair(TokenType.STAR, TokenType.SLASH): 92 self._advance() 93 94 if not self._curr: 95 self.raise_error("Expected */ after HINT") 96 97 end = self._tokens[self._index - 3] 98 return exp.Hint(expressions=[self._find_sql(start, end)]) 99 100 return None 101 102 class Generator(generator.Generator): 103 LOCKING_READS_SUPPORTED = True 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.Hint: lambda self, e: f" /*+ {self.expressions(e).strip()} */", 124 exp.ILike: no_ilike_sql, 125 exp.Matches: rename_func("DECODE"), 126 exp.StrToTime: lambda self, e: f"TO_TIMESTAMP({self.sql(e, 'this')}, {self.format_time(e)})", 127 exp.Subquery: lambda self, e: self.subquery_sql(e, sep=" "), 128 exp.Substring: rename_func("SUBSTR"), 129 exp.Table: lambda self, e: self.table_sql(e, sep=" "), 130 exp.TimeToStr: lambda self, e: f"TO_CHAR({self.sql(e, 'this')}, {self.format_time(e)})", 131 exp.ToChar: lambda self, e: self.function_fallback_sql(e), 132 exp.Trim: trim_sql, 133 exp.UnixToTime: lambda self, e: f"TO_DATE('1970-01-01','YYYY-MM-DD') + ({self.sql(e, 'this')} / 86400)", 134 } 135 136 LIMIT_FETCH = "FETCH" 137 138 def offset_sql(self, expression: exp.Offset) -> str: 139 return f"{super().offset_sql(expression)} ROWS" 140 141 def column_sql(self, expression: exp.Column) -> str: 142 column = super().column_sql(expression) 143 return f"{column} (+)" if expression.args.get("join_mark") else column 144 145 def xmltable_sql(self, expression: exp.XMLTable) -> str: 146 this = self.sql(expression, "this") 147 passing = self.expressions(expression, "passing") 148 passing = f"{self.sep()}PASSING{self.seg(passing)}" if passing else "" 149 columns = self.expressions(expression, "columns") 150 columns = f"{self.sep()}COLUMNS{self.seg(columns)}" if columns else "" 151 by_ref = ( 152 f"{self.sep()}RETURNING SEQUENCE BY REF" if expression.args.get("by_ref") else "" 153 ) 154 return f"XMLTABLE({self.sep('')}{self.indent(this + passing + by_ref + columns)}{self.seg(')', sep='')}" 155 156 class Tokenizer(tokens.Tokenizer): 157 KEYWORDS = { 158 **tokens.Tokenizer.KEYWORDS, 159 "(+)": TokenType.JOIN_MARKER, 160 "COLUMNS": TokenType.COLUMN, 161 "MATCH_RECOGNIZE": TokenType.MATCH_RECOGNIZE, 162 "MINUS": TokenType.EXCEPT, 163 "NVARCHAR2": TokenType.NVARCHAR, 164 "RETURNING": TokenType.RETURNING, 165 "START": TokenType.BEGIN, 166 "TOP": TokenType.TOP, 167 "VARCHAR2": TokenType.VARCHAR, 168 }
44class Oracle(Dialect): 45 # https://docs.oracle.com/database/121/SQLRF/sql_elements004.htm#SQLRF00212 46 # https://docs.python.org/3/library/datetime.html#strftime-and-strptime-format-codes 47 time_mapping = { 48 "AM": "%p", # Meridian indicator with or without periods 49 "A.M.": "%p", # Meridian indicator with or without periods 50 "PM": "%p", # Meridian indicator with or without periods 51 "P.M.": "%p", # Meridian indicator with or without periods 52 "D": "%u", # Day of week (1-7) 53 "DAY": "%A", # name of day 54 "DD": "%d", # day of month (1-31) 55 "DDD": "%j", # day of year (1-366) 56 "DY": "%a", # abbreviated name of day 57 "HH": "%I", # Hour of day (1-12) 58 "HH12": "%I", # alias for HH 59 "HH24": "%H", # Hour of day (0-23) 60 "IW": "%V", # Calendar week of year (1-52 or 1-53), as defined by the ISO 8601 standard 61 "MI": "%M", # Minute (0-59) 62 "MM": "%m", # Month (01-12; January = 01) 63 "MON": "%b", # Abbreviated name of month 64 "MONTH": "%B", # Name of month 65 "SS": "%S", # Second (0-59) 66 "WW": "%W", # Week of year (1-53) 67 "YY": "%y", # 15 68 "YYYY": "%Y", # 2015 69 } 70 71 class Parser(parser.Parser): 72 FUNCTIONS = { 73 **parser.Parser.FUNCTIONS, # type: ignore 74 "DECODE": exp.Matches.from_arg_list, 75 "SQUARE": lambda args: exp.Pow(this=seq_get(args, 0), expression=exp.Literal.number(2)), 76 } 77 78 FUNCTION_PARSERS: t.Dict[str, t.Callable] = { 79 **parser.Parser.FUNCTION_PARSERS, 80 "XMLTABLE": _parse_xml_table, 81 } 82 83 def _parse_column(self) -> t.Optional[exp.Expression]: 84 column = super()._parse_column() 85 if column: 86 column.set("join_mark", self._match(TokenType.JOIN_MARKER)) 87 return column 88 89 def _parse_hint(self) -> t.Optional[exp.Expression]: 90 if self._match(TokenType.HINT): 91 start = self._curr 92 while self._curr and not self._match_pair(TokenType.STAR, TokenType.SLASH): 93 self._advance() 94 95 if not self._curr: 96 self.raise_error("Expected */ after HINT") 97 98 end = self._tokens[self._index - 3] 99 return exp.Hint(expressions=[self._find_sql(start, end)]) 100 101 return None 102 103 class Generator(generator.Generator): 104 LOCKING_READS_SUPPORTED = True 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.Hint: lambda self, e: f" /*+ {self.expressions(e).strip()} */", 125 exp.ILike: no_ilike_sql, 126 exp.Matches: rename_func("DECODE"), 127 exp.StrToTime: lambda self, e: f"TO_TIMESTAMP({self.sql(e, 'this')}, {self.format_time(e)})", 128 exp.Subquery: lambda self, e: self.subquery_sql(e, sep=" "), 129 exp.Substring: rename_func("SUBSTR"), 130 exp.Table: lambda self, e: self.table_sql(e, sep=" "), 131 exp.TimeToStr: lambda self, e: f"TO_CHAR({self.sql(e, 'this')}, {self.format_time(e)})", 132 exp.ToChar: lambda self, e: self.function_fallback_sql(e), 133 exp.Trim: trim_sql, 134 exp.UnixToTime: lambda self, e: f"TO_DATE('1970-01-01','YYYY-MM-DD') + ({self.sql(e, 'this')} / 86400)", 135 } 136 137 LIMIT_FETCH = "FETCH" 138 139 def offset_sql(self, expression: exp.Offset) -> str: 140 return f"{super().offset_sql(expression)} ROWS" 141 142 def column_sql(self, expression: exp.Column) -> str: 143 column = super().column_sql(expression) 144 return f"{column} (+)" if expression.args.get("join_mark") else column 145 146 def xmltable_sql(self, expression: exp.XMLTable) -> str: 147 this = self.sql(expression, "this") 148 passing = self.expressions(expression, "passing") 149 passing = f"{self.sep()}PASSING{self.seg(passing)}" if passing else "" 150 columns = self.expressions(expression, "columns") 151 columns = f"{self.sep()}COLUMNS{self.seg(columns)}" if columns else "" 152 by_ref = ( 153 f"{self.sep()}RETURNING SEQUENCE BY REF" if expression.args.get("by_ref") else "" 154 ) 155 return f"XMLTABLE({self.sep('')}{self.indent(this + passing + by_ref + columns)}{self.seg(')', sep='')}" 156 157 class Tokenizer(tokens.Tokenizer): 158 KEYWORDS = { 159 **tokens.Tokenizer.KEYWORDS, 160 "(+)": TokenType.JOIN_MARKER, 161 "COLUMNS": TokenType.COLUMN, 162 "MATCH_RECOGNIZE": TokenType.MATCH_RECOGNIZE, 163 "MINUS": TokenType.EXCEPT, 164 "NVARCHAR2": TokenType.NVARCHAR, 165 "RETURNING": TokenType.RETURNING, 166 "START": TokenType.BEGIN, 167 "TOP": TokenType.TOP, 168 "VARCHAR2": TokenType.VARCHAR, 169 }
71 class Parser(parser.Parser): 72 FUNCTIONS = { 73 **parser.Parser.FUNCTIONS, # type: ignore 74 "DECODE": exp.Matches.from_arg_list, 75 "SQUARE": lambda args: exp.Pow(this=seq_get(args, 0), expression=exp.Literal.number(2)), 76 } 77 78 FUNCTION_PARSERS: t.Dict[str, t.Callable] = { 79 **parser.Parser.FUNCTION_PARSERS, 80 "XMLTABLE": _parse_xml_table, 81 } 82 83 def _parse_column(self) -> t.Optional[exp.Expression]: 84 column = super()._parse_column() 85 if column: 86 column.set("join_mark", self._match(TokenType.JOIN_MARKER)) 87 return column 88 89 def _parse_hint(self) -> t.Optional[exp.Expression]: 90 if self._match(TokenType.HINT): 91 start = self._curr 92 while self._curr and not self._match_pair(TokenType.STAR, TokenType.SLASH): 93 self._advance() 94 95 if not self._curr: 96 self.raise_error("Expected */ after HINT") 97 98 end = self._tokens[self._index - 3] 99 return exp.Hint(expressions=[self._find_sql(start, end)]) 100 101 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
103 class Generator(generator.Generator): 104 LOCKING_READS_SUPPORTED = True 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.Hint: lambda self, e: f" /*+ {self.expressions(e).strip()} */", 125 exp.ILike: no_ilike_sql, 126 exp.Matches: rename_func("DECODE"), 127 exp.StrToTime: lambda self, e: f"TO_TIMESTAMP({self.sql(e, 'this')}, {self.format_time(e)})", 128 exp.Subquery: lambda self, e: self.subquery_sql(e, sep=" "), 129 exp.Substring: rename_func("SUBSTR"), 130 exp.Table: lambda self, e: self.table_sql(e, sep=" "), 131 exp.TimeToStr: lambda self, e: f"TO_CHAR({self.sql(e, 'this')}, {self.format_time(e)})", 132 exp.ToChar: lambda self, e: self.function_fallback_sql(e), 133 exp.Trim: trim_sql, 134 exp.UnixToTime: lambda self, e: f"TO_DATE('1970-01-01','YYYY-MM-DD') + ({self.sql(e, 'this')} / 86400)", 135 } 136 137 LIMIT_FETCH = "FETCH" 138 139 def offset_sql(self, expression: exp.Offset) -> str: 140 return f"{super().offset_sql(expression)} ROWS" 141 142 def column_sql(self, expression: exp.Column) -> str: 143 column = super().column_sql(expression) 144 return f"{column} (+)" if expression.args.get("join_mark") else column 145 146 def xmltable_sql(self, expression: exp.XMLTable) -> str: 147 this = self.sql(expression, "this") 148 passing = self.expressions(expression, "passing") 149 passing = f"{self.sep()}PASSING{self.seg(passing)}" if passing else "" 150 columns = self.expressions(expression, "columns") 151 columns = f"{self.sep()}COLUMNS{self.seg(columns)}" if columns else "" 152 by_ref = ( 153 f"{self.sep()}RETURNING SEQUENCE BY REF" if expression.args.get("by_ref") else "" 154 ) 155 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
146 def xmltable_sql(self, expression: exp.XMLTable) -> str: 147 this = self.sql(expression, "this") 148 passing = self.expressions(expression, "passing") 149 passing = f"{self.sep()}PASSING{self.seg(passing)}" if passing else "" 150 columns = self.expressions(expression, "columns") 151 columns = f"{self.sep()}COLUMNS{self.seg(columns)}" if columns else "" 152 by_ref = ( 153 f"{self.sep()}RETURNING SEQUENCE BY REF" if expression.args.get("by_ref") else "" 154 ) 155 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
- 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
- datatype_sql
- directory_sql
- delete_sql
- drop_sql
- except_sql
- except_op
- fetch_sql
- filter_sql
- hint_sql
- index_sql
- identifier_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
- 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
- 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
- is_sql
- like_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
157 class Tokenizer(tokens.Tokenizer): 158 KEYWORDS = { 159 **tokens.Tokenizer.KEYWORDS, 160 "(+)": TokenType.JOIN_MARKER, 161 "COLUMNS": TokenType.COLUMN, 162 "MATCH_RECOGNIZE": TokenType.MATCH_RECOGNIZE, 163 "MINUS": TokenType.EXCEPT, 164 "NVARCHAR2": TokenType.NVARCHAR, 165 "RETURNING": TokenType.RETURNING, 166 "START": TokenType.BEGIN, 167 "TOP": TokenType.TOP, 168 "VARCHAR2": TokenType.VARCHAR, 169 }