Coverage for /pythoncovmergedfiles/medio/medio/usr/local/lib/python3.11/site-packages/sqlparse/keywords.py: 98%
Shortcuts on this page
r m x toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
Shortcuts on this page
r m x toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
1#
2# Copyright (C) 2009-2020 the sqlparse authors and contributors
3# <see AUTHORS file>
4#
5# This module is part of python-sqlparse and is released under
6# the BSD License: https://opensource.org/licenses/BSD-3-Clause
8import re
9from bisect import bisect_left
10from collections import defaultdict
12from sqlparse import tokens
14# object() only supports "is" and is useful as a marker
15# use this marker to specify that the given regex in SQL_REGEX
16# shall be processed further through a lookup in the KEYWORDS dictionaries
17PROCESS_AS_KEYWORD = object()
20# Dollar-quoted literals (`$tag$...$tag$`) and multiline comments
21# (`/*...*/`, `/*+...*/`) used to be matched with per-position regexes
22# using a lazy dot-all quantifier (`[\s\S]*?`) terminated by a
23# backreference or a literal delimiter. Applied at every text position by
24# the lexer loop, that shape is O(n^2) on adversarial input with many
25# unclosed openers, since each failed attempt re-scans to the end of the
26# remaining text (GHSA-prg7-hcfm-mfcr). find_delimited_spans() collects
27# all opener and closer positions in a single pass instead, so the lexer
28# can pair them with a binary search when it actually reaches an opener.
29#
30# The delimiter regex is wrapped in a lookahead so that overlapping
31# occurrences are reported too: in `$$$$` the closing `$$` starts inside
32# the match of the opening one, and a non-overlapping scan would miss it.
33_DOLLAR_QUOTE_DELIM = re.compile(
34 r'(?=(\$(?:[_A-ZÀ-Ü]\w*)?\$))', re.IGNORECASE | re.UNICODE)
35_DOLLAR_QUOTE_OPENER_OK = re.compile(r'(?<![\w"$])', re.UNICODE)
36_COMMENT_HINT_OPEN = re.compile(r'/\*\+')
37_COMMENT_OPEN = re.compile(r'/\*(?!\+)')
38_COMMENT_CLOSE = re.compile(r'\*/')
40# All multiline comments share a single closer (`*/`), so one bucket is
41# enough; dollar-quoted literals are bucketed by their tag.
42_COMMENT_TAG = '/*'
45class DelimitedSpans:
46 """Opener and closer positions of dollar-quoted literals and multiline
47 comments, resolved on demand by :meth:`resolve`.
49 Pairing has to happen at the position the lexer has actually reached,
50 not upfront: a `/*`, `*/` or `$$` inside a string literal or behind a
51 `--` comment is not a delimiter at all, and resolving it eagerly would
52 consume the partner of the next real delimiter.
53 """
55 __slots__ = ('_closers', 'openers')
57 def __init__(self, openers, closers):
58 #: start offset -> (offset behind the opener, tag, token type)
59 self.openers = openers
60 #: tag -> ([closer start, ...], [closer end, ...]), both ascending
61 self._closers = closers
63 def resolve(self, pos):
64 """Return ``(end offset, token type)`` for the span opening at
65 `pos`, or None if its closing delimiter is missing -- just as a
66 regex that never finds its closing delimiter fails to match.
67 """
68 opener_end, tag, ttype = self.openers[pos]
69 starts, ends = self._closers[tag]
70 idx = bisect_left(starts, opener_end)
71 if idx == len(starts):
72 return None
73 return ends[idx], ttype
76_NO_SPANS = DelimitedSpans({}, {})
79def find_delimited_spans(text):
80 """Locate the delimiters of dollar-quoted literals and multiline
81 comments in `text` and return them as a :class:`DelimitedSpans`.
82 """
83 has_dollar = '$' in text
84 # A comment can only ever open on "/*"; without it "*/" alone can
85 # never pair with anything, so gating on "/*" alone is sufficient to
86 # skip all three comment-related regex passes below.
87 has_comment_open = '/*' in text
88 if not has_dollar and not has_comment_open:
89 return _NO_SPANS
91 openers = {}
92 closers = defaultdict(lambda: ([], []))
93 if has_dollar:
94 for m in _DOLLAR_QUOTE_DELIM.finditer(text):
95 start = m.start()
96 tag = m.group(1)
97 end = start + len(tag)
98 # Every delimiter can close a literal, but one preceded by a
99 # word character, `"` or `$` cannot open one.
100 starts, ends = closers[tag]
101 starts.append(start)
102 ends.append(end)
103 if _DOLLAR_QUOTE_OPENER_OK.match(text, start) is not None:
104 openers[start] = (end, tag, tokens.Literal)
105 if has_comment_open:
106 for m in _COMMENT_HINT_OPEN.finditer(text):
107 openers[m.start()] = (
108 m.end(), _COMMENT_TAG, tokens.Comment.Multiline.Hint)
109 for m in _COMMENT_OPEN.finditer(text):
110 openers[m.start()] = (
111 m.end(), _COMMENT_TAG, tokens.Comment.Multiline)
112 starts, ends = closers[_COMMENT_TAG]
113 for m in _COMMENT_CLOSE.finditer(text):
114 starts.append(m.start())
115 ends.append(m.end())
116 return DelimitedSpans(openers, closers)
119SQL_REGEX = [
120 (r'(--|# )\+.*?(\r\n|\r|\n|$)', tokens.Comment.Single.Hint),
122 (r'(--|# ).*?(\r\n|\r|\n|$)', tokens.Comment.Single),
124 (r'(\r\n|\r|\n)', tokens.Newline),
125 (r'\s+?', tokens.Whitespace),
127 (r':=', tokens.Assignment),
128 (r'::', tokens.Punctuation),
130 (r'\*', tokens.Wildcard),
132 (r"`(``|[^`])*`", tokens.Name),
133 (r"´(´´|[^´])*´", tokens.Name),
135 (r'\?', tokens.Name.Placeholder),
136 (r'%(\(\w+\))?s', tokens.Name.Placeholder),
137 (r'(?<!\w)[$:?]\w+', tokens.Name.Placeholder),
139 (r'\\\w+', tokens.Command),
141 # FIXME(andi): VALUES shouldn't be listed here
142 # see https://github.com/andialbrecht/sqlparse/pull/64
143 # AS and IN are special, it may be followed by a parenthesis, but
144 # are never functions, see issue183 and issue507
145 (r'(CASE|IN|VALUES|USING|FROM|AS)\b', tokens.Keyword),
147 (r'(@|##|#)[A-ZÀ-Ü]\w+', tokens.Name),
149 # see issue #39
150 # Spaces around period `schema . name` are valid identifier
151 # TODO: Spaces before period not implemented
152 # The negative lookahead ``(?!\d)`` keeps a following floating point
153 # literal such as ``.03`` from being mistaken for a member access, so a
154 # preceding keyword (e.g. ``BETWEEN``) is not reclassified as a name.
155 # See issue #601.
156 (r'[A-ZÀ-Ü]\w*(?=\s*\.(?!\d))', tokens.Name), # 'Name'.
157 # FIXME(atronah): never match,
158 # because `re.match` doesn't work with look-behind regexp feature
159 (r'(?<=\.)[A-ZÀ-Ü]\w*', tokens.Name), # .'Name'
160 (r'[A-ZÀ-Ü]\w*(?=\()', tokens.Name), # side effect: change kw to func
161 (r'-?0x[\dA-F]+', tokens.Number.Hexadecimal),
162 (r'-?\d+(\.\d+)?E-?\d+', tokens.Number.Float),
163 (r'(?![_A-ZÀ-Ü])-?(\d+(\.\d*)|\.\d+)(?![_A-ZÀ-Ü])',
164 tokens.Number.Float),
165 (r'(?![_A-ZÀ-Ü])-?\d+(?![_A-ZÀ-Ü])', tokens.Number.Integer),
166 (r"'(''|\\'|[^'])*'", tokens.String.Single),
167 # not a real string literal in ANSI SQL:
168 (r'"(""|\\"|[^"])*"', tokens.String.Symbol),
169 (r'(""|".*?[^\\]")', tokens.String.Symbol),
170 # sqlite names can be escaped with [square brackets]. left bracket
171 # cannot be preceded by word character or a right bracket --
172 # otherwise it's probably an array index
173 (r'(?<![\w\])])(\[[^\]\[]+\])', tokens.Name),
174 (r'((LEFT\s+|RIGHT\s+|FULL\s+)?(INNER\s+|OUTER\s+|STRAIGHT\s+)?'
175 r'|(CROSS\s+|NATURAL\s+)?)?JOIN\b', tokens.Keyword),
176 (r'END(\s+IF|\s+LOOP|\s+WHILE|\s+FOR|\s+CASE)?\b', tokens.Keyword),
177 (r'IF\s+(NOT\s+)?EXISTS\b', tokens.Keyword),
178 (r'NOT\s+NULL\b', tokens.Keyword),
179 (r'(ASC|DESC)(\s+NULLS\s+(FIRST|LAST))?\b', tokens.Keyword.Order),
180 (r'(ASC|DESC)\b', tokens.Keyword.Order),
181 (r'NULLS\s+(FIRST|LAST)\b', tokens.Keyword.Order),
182 (r'UNION\s+ALL\b', tokens.Keyword),
183 (r'CREATE(\s+OR\s+REPLACE)?\b', tokens.Keyword.DDL),
184 (r'DOUBLE\s+PRECISION\b', tokens.Name.Builtin),
185 (r'GROUP\s+BY\b', tokens.Keyword),
186 (r'ORDER\s+BY\b', tokens.Keyword),
187 (r'PRIMARY\s+KEY\b', tokens.Keyword),
188 (r'HANDLER\s+FOR\b', tokens.Keyword),
189 (r'GO(\s\d+)\b', tokens.Keyword),
190 (r'(LATERAL\s+VIEW\s+)'
191 r'(EXPLODE|INLINE|PARSE_URL_TUPLE|POSEXPLODE|STACK)\b',
192 tokens.Keyword),
193 (r"(AT|WITH')\s+TIME\s+ZONE\s+'[^']+'", tokens.Keyword.TZCast),
194 (r'(NOT\s+)?(LIKE|ILIKE|RLIKE)\b', tokens.Operator.Comparison),
195 (r'(NOT\s+)?(REGEXP)(\s+(BINARY))?\b', tokens.Operator.Comparison),
196 # Check for keywords, also returns tokens.Name if regex matches
197 # but the match isn't a keyword.
198 (r'\w[$#\w]*', PROCESS_AS_KEYWORD),
199 (r'[;:()\[\],\.]', tokens.Punctuation),
200 # JSON operators
201 (r'(\->>?|#>>?|@>|<@|\?\|?|\?&|\-|#\-)', tokens.Operator),
202 (r'[<>=~!]+', tokens.Operator.Comparison),
203 (r'[+/@#%^&|^-]+', tokens.Operator),
204]
206KEYWORDS = {
207 'ABORT': tokens.Keyword,
208 'ABS': tokens.Keyword,
209 'ABSOLUTE': tokens.Keyword,
210 'ACCESS': tokens.Keyword,
211 'ADA': tokens.Keyword,
212 'ADD': tokens.Keyword,
213 'ADMIN': tokens.Keyword,
214 'AFTER': tokens.Keyword,
215 'AGGREGATE': tokens.Keyword,
216 'ALIAS': tokens.Keyword,
217 'ALL': tokens.Keyword,
218 'ALLOCATE': tokens.Keyword,
219 'ANALYSE': tokens.Keyword,
220 'ANALYZE': tokens.Keyword,
221 'ANY': tokens.Keyword,
222 'ARRAYLEN': tokens.Keyword,
223 'ARE': tokens.Keyword,
224 'ASENSITIVE': tokens.Keyword,
225 'ASSERTION': tokens.Keyword,
226 'ASSIGNMENT': tokens.Keyword,
227 'ASYMMETRIC': tokens.Keyword,
228 'AT': tokens.Keyword,
229 'ATOMIC': tokens.Keyword,
230 'AUDIT': tokens.Keyword,
231 'AUTHORIZATION': tokens.Keyword,
232 'AUTO_INCREMENT': tokens.Keyword,
233 'AVG': tokens.Keyword,
235 'BACKWARD': tokens.Keyword,
236 'BEFORE': tokens.Keyword,
237 'BEGIN': tokens.Keyword,
238 'BETWEEN': tokens.Keyword,
239 'BITVAR': tokens.Keyword,
240 'BIT_LENGTH': tokens.Keyword,
241 'BOTH': tokens.Keyword,
242 'BREADTH': tokens.Keyword,
244 # 'C': tokens.Keyword, # most likely this is an alias
245 'CACHE': tokens.Keyword,
246 'CALL': tokens.Keyword,
247 'CALLED': tokens.Keyword,
248 'CARDINALITY': tokens.Keyword,
249 'CASCADE': tokens.Keyword,
250 'CASCADED': tokens.Keyword,
251 'CAST': tokens.Keyword,
252 'CATALOG': tokens.Keyword,
253 'CATALOG_NAME': tokens.Keyword,
254 'CHAIN': tokens.Keyword,
255 'CHARACTERISTICS': tokens.Keyword,
256 'CHARACTER_LENGTH': tokens.Keyword,
257 'CHARACTER_SET_CATALOG': tokens.Keyword,
258 'CHARACTER_SET_NAME': tokens.Keyword,
259 'CHARACTER_SET_SCHEMA': tokens.Keyword,
260 'CHAR_LENGTH': tokens.Keyword,
261 'CHARSET': tokens.Keyword,
262 'CHECK': tokens.Keyword,
263 'CHECKED': tokens.Keyword,
264 'CHECKPOINT': tokens.Keyword,
265 'CLASS': tokens.Keyword,
266 'CLASS_ORIGIN': tokens.Keyword,
267 'CLOB': tokens.Keyword,
268 'CLOSE': tokens.Keyword,
269 'CLUSTER': tokens.Keyword,
270 'COALESCE': tokens.Keyword,
271 'COBOL': tokens.Keyword,
272 'COLLATE': tokens.Keyword,
273 'COLLATION': tokens.Keyword,
274 'COLLATION_CATALOG': tokens.Keyword,
275 'COLLATION_NAME': tokens.Keyword,
276 'COLLATION_SCHEMA': tokens.Keyword,
277 'COLLECT': tokens.Keyword,
278 'COLUMN': tokens.Keyword,
279 'COLUMN_NAME': tokens.Keyword,
280 'COMPRESS': tokens.Keyword,
281 'COMMAND_FUNCTION': tokens.Keyword,
282 'COMMAND_FUNCTION_CODE': tokens.Keyword,
283 'COMMENT': tokens.Keyword,
284 'COMMIT': tokens.Keyword.DML,
285 'COMMITTED': tokens.Keyword,
286 'COMPLETION': tokens.Keyword,
287 'CONCURRENTLY': tokens.Keyword,
288 'CONDITION_NUMBER': tokens.Keyword,
289 'CONNECT': tokens.Keyword,
290 'CONNECTION': tokens.Keyword,
291 'CONNECTION_NAME': tokens.Keyword,
292 'CONSTRAINT': tokens.Keyword,
293 'CONSTRAINTS': tokens.Keyword,
294 'CONSTRAINT_CATALOG': tokens.Keyword,
295 'CONSTRAINT_NAME': tokens.Keyword,
296 'CONSTRAINT_SCHEMA': tokens.Keyword,
297 'CONSTRUCTOR': tokens.Keyword,
298 'CONTAINS': tokens.Keyword,
299 'CONTINUE': tokens.Keyword,
300 'CONVERSION': tokens.Keyword,
301 'CONVERT': tokens.Keyword,
302 'COPY': tokens.Keyword,
303 'CORRESPONDING': tokens.Keyword,
304 'COUNT': tokens.Keyword,
305 'CREATEDB': tokens.Keyword,
306 'CREATEUSER': tokens.Keyword,
307 'CROSS': tokens.Keyword,
308 'CUBE': tokens.Keyword,
309 'CURRENT': tokens.Keyword,
310 'CURRENT_DATE': tokens.Keyword,
311 'CURRENT_PATH': tokens.Keyword,
312 'CURRENT_ROLE': tokens.Keyword,
313 'CURRENT_TIME': tokens.Keyword,
314 'CURRENT_TIMESTAMP': tokens.Keyword,
315 'CURRENT_USER': tokens.Keyword,
316 'CURSOR': tokens.Keyword,
317 'CURSOR_NAME': tokens.Keyword,
318 'CYCLE': tokens.Keyword,
320 'DATA': tokens.Keyword,
321 'DATABASE': tokens.Keyword,
322 'DATETIME_INTERVAL_CODE': tokens.Keyword,
323 'DATETIME_INTERVAL_PRECISION': tokens.Keyword,
324 'DAY': tokens.Keyword,
325 'DEALLOCATE': tokens.Keyword,
326 'DECLARE': tokens.Keyword,
327 'DEFAULT': tokens.Keyword,
328 'DEFAULTS': tokens.Keyword,
329 'DEFERRABLE': tokens.Keyword,
330 'DEFERRED': tokens.Keyword,
331 'DEFINED': tokens.Keyword,
332 'DEFINER': tokens.Keyword,
333 'DELIMITER': tokens.Keyword,
334 'DELIMITERS': tokens.Keyword,
335 'DEREF': tokens.Keyword,
336 'DESCRIBE': tokens.Keyword,
337 'DESCRIPTOR': tokens.Keyword,
338 'DESTROY': tokens.Keyword,
339 'DESTRUCTOR': tokens.Keyword,
340 'DETERMINISTIC': tokens.Keyword,
341 'DIAGNOSTICS': tokens.Keyword,
342 'DICTIONARY': tokens.Keyword,
343 'DISABLE': tokens.Keyword,
344 'DISCONNECT': tokens.Keyword,
345 'DISPATCH': tokens.Keyword,
346 'DIV': tokens.Operator,
347 'DO': tokens.Keyword,
348 'DOMAIN': tokens.Keyword,
349 'DYNAMIC': tokens.Keyword,
350 'DYNAMIC_FUNCTION': tokens.Keyword,
351 'DYNAMIC_FUNCTION_CODE': tokens.Keyword,
353 'EACH': tokens.Keyword,
354 'ENABLE': tokens.Keyword,
355 'ENCODING': tokens.Keyword,
356 'ENCRYPTED': tokens.Keyword,
357 'END-EXEC': tokens.Keyword,
358 'ENGINE': tokens.Keyword,
359 'EQUALS': tokens.Keyword,
360 'ESCAPE': tokens.Keyword,
361 'EVERY': tokens.Keyword,
362 'EXCEPT': tokens.Keyword,
363 'EXCEPTION': tokens.Keyword,
364 'EXCLUDING': tokens.Keyword,
365 'EXCLUSIVE': tokens.Keyword,
366 'EXEC': tokens.Keyword,
367 'EXECUTE': tokens.Keyword,
368 'EXISTING': tokens.Keyword,
369 'EXISTS': tokens.Keyword,
370 'EXPLAIN': tokens.Keyword,
371 'EXTERNAL': tokens.Keyword,
372 'EXTRACT': tokens.Keyword,
374 'FALSE': tokens.Keyword,
375 'FETCH': tokens.Keyword,
376 'FILE': tokens.Keyword,
377 'FINAL': tokens.Keyword,
378 'FIRST': tokens.Keyword,
379 'FORCE': tokens.Keyword,
380 'FOREACH': tokens.Keyword,
381 'FOREIGN': tokens.Keyword,
382 'FORTRAN': tokens.Keyword,
383 'FORWARD': tokens.Keyword,
384 'FOUND': tokens.Keyword,
385 'FREE': tokens.Keyword,
386 'FREEZE': tokens.Keyword,
387 'FULL': tokens.Keyword,
388 'FUNCTION': tokens.Keyword,
390 # 'G': tokens.Keyword,
391 'GENERAL': tokens.Keyword,
392 'GENERATED': tokens.Keyword,
393 'GET': tokens.Keyword,
394 'GLOBAL': tokens.Keyword,
395 'GO': tokens.Keyword,
396 'GOTO': tokens.Keyword,
397 'GRANTED': tokens.Keyword,
398 'GROUPING': tokens.Keyword,
400 'HAVING': tokens.Keyword,
401 'HIERARCHY': tokens.Keyword,
402 'HOLD': tokens.Keyword,
403 'HOUR': tokens.Keyword,
404 'HOST': tokens.Keyword,
406 'IDENTIFIED': tokens.Keyword,
407 'IDENTITY': tokens.Keyword,
408 'IGNORE': tokens.Keyword,
409 'ILIKE': tokens.Keyword,
410 'IMMEDIATE': tokens.Keyword,
411 'IMMUTABLE': tokens.Keyword,
413 'IMPLEMENTATION': tokens.Keyword,
414 'IMPLICIT': tokens.Keyword,
415 'INCLUDING': tokens.Keyword,
416 'INCREMENT': tokens.Keyword,
417 'INDEX': tokens.Keyword,
419 'INDICATOR': tokens.Keyword,
420 'INFIX': tokens.Keyword,
421 'INHERITS': tokens.Keyword,
422 'INITIAL': tokens.Keyword,
423 'INITIALIZE': tokens.Keyword,
424 'INITIALLY': tokens.Keyword,
425 'INOUT': tokens.Keyword,
426 'INPUT': tokens.Keyword,
427 'INSENSITIVE': tokens.Keyword,
428 'INSTANTIABLE': tokens.Keyword,
429 'INSTEAD': tokens.Keyword,
430 'INTERSECT': tokens.Keyword,
431 'INTO': tokens.Keyword,
432 'INVOKER': tokens.Keyword,
433 'IS': tokens.Keyword,
434 'ISNULL': tokens.Keyword,
435 'ISOLATION': tokens.Keyword,
436 'ITERATE': tokens.Keyword,
438 # 'K': tokens.Keyword,
439 'KEY': tokens.Keyword,
440 'KEY_MEMBER': tokens.Keyword,
441 'KEY_TYPE': tokens.Keyword,
443 'LANCOMPILER': tokens.Keyword,
444 'LANGUAGE': tokens.Keyword,
445 'LARGE': tokens.Keyword,
446 'LAST': tokens.Keyword,
447 'LATERAL': tokens.Keyword,
448 'LEADING': tokens.Keyword,
449 'LENGTH': tokens.Keyword,
450 'LESS': tokens.Keyword,
451 'LEVEL': tokens.Keyword,
452 'LIMIT': tokens.Keyword,
453 'LISTEN': tokens.Keyword,
454 'LOAD': tokens.Keyword,
455 'LOCAL': tokens.Keyword,
456 'LOCALTIME': tokens.Keyword,
457 'LOCALTIMESTAMP': tokens.Keyword,
458 'LOCATION': tokens.Keyword,
459 'LOCATOR': tokens.Keyword,
460 'LOCK': tokens.Keyword,
461 'LOWER': tokens.Keyword,
463 # 'M': tokens.Keyword,
464 'MAP': tokens.Keyword,
465 'MATCH': tokens.Keyword,
466 'MATERIALIZED': tokens.Keyword,
467 'MAXEXTENTS': tokens.Keyword,
468 'MAXVALUE': tokens.Keyword,
469 'MESSAGE_LENGTH': tokens.Keyword,
470 'MESSAGE_OCTET_LENGTH': tokens.Keyword,
471 'MESSAGE_TEXT': tokens.Keyword,
472 'METHOD': tokens.Keyword,
473 'MINUTE': tokens.Keyword,
474 'MINUS': tokens.Keyword,
475 'MINVALUE': tokens.Keyword,
476 'MOD': tokens.Keyword,
477 'MODE': tokens.Keyword,
478 'MODIFIES': tokens.Keyword,
479 'MODIFY': tokens.Keyword,
480 'MONTH': tokens.Keyword,
481 'MORE': tokens.Keyword,
482 'MOVE': tokens.Keyword,
483 'MUMPS': tokens.Keyword,
485 'NAMES': tokens.Keyword,
486 'NATIONAL': tokens.Keyword,
487 'NATURAL': tokens.Keyword,
488 'NCHAR': tokens.Keyword,
489 'NCLOB': tokens.Keyword,
490 'NEW': tokens.Keyword,
491 'NEXT': tokens.Keyword,
492 'NO': tokens.Keyword,
493 'NOAUDIT': tokens.Keyword,
494 'NOCOMPRESS': tokens.Keyword,
495 'NOCREATEDB': tokens.Keyword,
496 'NOCREATEUSER': tokens.Keyword,
497 'NONE': tokens.Keyword,
498 'NOT': tokens.Keyword,
499 'NOTFOUND': tokens.Keyword,
500 'NOTHING': tokens.Keyword,
501 'NOTIFY': tokens.Keyword,
502 'NOTNULL': tokens.Keyword,
503 'NOWAIT': tokens.Keyword,
504 'NULL': tokens.Keyword,
505 'NULLABLE': tokens.Keyword,
506 'NULLIF': tokens.Keyword,
508 'OBJECT': tokens.Keyword,
509 'OCTET_LENGTH': tokens.Keyword,
510 'OF': tokens.Keyword,
511 'OFF': tokens.Keyword,
512 'OFFLINE': tokens.Keyword,
513 'OFFSET': tokens.Keyword,
514 'OIDS': tokens.Keyword,
515 'OLD': tokens.Keyword,
516 'ONLINE': tokens.Keyword,
517 'ONLY': tokens.Keyword,
518 'OPEN': tokens.Keyword,
519 'OPERATION': tokens.Keyword,
520 'OPERATOR': tokens.Keyword,
521 'OPTION': tokens.Keyword,
522 'OPTIONS': tokens.Keyword,
523 'ORDINALITY': tokens.Keyword,
524 'OUT': tokens.Keyword,
525 'OUTPUT': tokens.Keyword,
526 'OVERLAPS': tokens.Keyword,
527 'OVERLAY': tokens.Keyword,
528 'OVERRIDING': tokens.Keyword,
529 'OWNER': tokens.Keyword,
531 'QUARTER': tokens.Keyword,
533 'PAD': tokens.Keyword,
534 'PARAMETER': tokens.Keyword,
535 'PARAMETERS': tokens.Keyword,
536 'PARAMETER_MODE': tokens.Keyword,
537 'PARAMETER_NAME': tokens.Keyword,
538 'PARAMETER_ORDINAL_POSITION': tokens.Keyword,
539 'PARAMETER_SPECIFIC_CATALOG': tokens.Keyword,
540 'PARAMETER_SPECIFIC_NAME': tokens.Keyword,
541 'PARAMETER_SPECIFIC_SCHEMA': tokens.Keyword,
542 'PARTIAL': tokens.Keyword,
543 'PASCAL': tokens.Keyword,
544 'PCTFREE': tokens.Keyword,
545 'PENDANT': tokens.Keyword,
546 'PLACING': tokens.Keyword,
547 'PLI': tokens.Keyword,
548 'POSITION': tokens.Keyword,
549 'POSTFIX': tokens.Keyword,
550 'PRECISION': tokens.Keyword,
551 'PREFIX': tokens.Keyword,
552 'PREORDER': tokens.Keyword,
553 'PREPARE': tokens.Keyword,
554 'PRESERVE': tokens.Keyword,
555 'PRIMARY': tokens.Keyword,
556 'PRIOR': tokens.Keyword,
557 'PRIVILEGES': tokens.Keyword,
558 'PROCEDURAL': tokens.Keyword,
559 'PROCEDURE': tokens.Keyword,
560 'PUBLIC': tokens.Keyword,
562 'RAISE': tokens.Keyword,
563 'RAW': tokens.Keyword,
564 'READ': tokens.Keyword,
565 'READS': tokens.Keyword,
566 'RECHECK': tokens.Keyword,
567 'RECURSIVE': tokens.Keyword,
568 'REF': tokens.Keyword,
569 'REFERENCES': tokens.Keyword,
570 'REFERENCING': tokens.Keyword,
571 'REINDEX': tokens.Keyword,
572 'RELATIVE': tokens.Keyword,
573 'RENAME': tokens.Keyword,
574 'REPEATABLE': tokens.Keyword,
575 'RESET': tokens.Keyword,
576 'RESOURCE': tokens.Keyword,
577 'RESTART': tokens.Keyword,
578 'RESTRICT': tokens.Keyword,
579 'RESULT': tokens.Keyword,
580 'RETURN': tokens.Keyword,
581 'RETURNED_LENGTH': tokens.Keyword,
582 'RETURNED_OCTET_LENGTH': tokens.Keyword,
583 'RETURNED_SQLSTATE': tokens.Keyword,
584 'RETURNING': tokens.Keyword,
585 'RETURNS': tokens.Keyword,
586 'RIGHT': tokens.Keyword,
587 'ROLE': tokens.Keyword,
588 'ROLLBACK': tokens.Keyword.DML,
589 'ROLLUP': tokens.Keyword,
590 'ROUTINE': tokens.Keyword,
591 'ROUTINE_CATALOG': tokens.Keyword,
592 'ROUTINE_NAME': tokens.Keyword,
593 'ROUTINE_SCHEMA': tokens.Keyword,
594 'ROWS': tokens.Keyword,
595 'ROW_COUNT': tokens.Keyword,
596 'ROW_FORMAT': tokens.Keyword,
597 'RULE': tokens.Keyword,
599 'SAVE_POINT': tokens.Keyword,
600 'SCALE': tokens.Keyword,
601 'SCHEMA': tokens.Keyword,
602 'SCHEMA_NAME': tokens.Keyword,
603 'SCOPE': tokens.Keyword,
604 'SCROLL': tokens.Keyword,
605 'SEARCH': tokens.Keyword,
606 'SECOND': tokens.Keyword,
607 'SECURITY': tokens.Keyword,
608 'SELF': tokens.Keyword,
609 'SENSITIVE': tokens.Keyword,
610 'SEQUENCE': tokens.Keyword,
611 'SERIALIZABLE': tokens.Keyword,
612 'SERVER_NAME': tokens.Keyword,
613 'SESSION': tokens.Keyword,
614 'SESSION_USER': tokens.Keyword,
615 'SETOF': tokens.Keyword,
616 'SETS': tokens.Keyword,
617 'SHARE': tokens.Keyword,
618 'SHOW': tokens.Keyword,
619 'SIMILAR': tokens.Keyword,
620 'SIMPLE': tokens.Keyword,
621 'SIZE': tokens.Keyword,
622 'SOME': tokens.Keyword,
623 'SOURCE': tokens.Keyword,
624 'SPACE': tokens.Keyword,
625 'SPECIFIC': tokens.Keyword,
626 'SPECIFICTYPE': tokens.Keyword,
627 'SPECIFIC_NAME': tokens.Keyword,
628 'SQL': tokens.Keyword,
629 'SQLBUF': tokens.Keyword,
630 'SQLCODE': tokens.Keyword,
631 'SQLERROR': tokens.Keyword,
632 'SQLEXCEPTION': tokens.Keyword,
633 'SQLSTATE': tokens.Keyword,
634 'SQLWARNING': tokens.Keyword,
635 'STABLE': tokens.Keyword,
636 'START': tokens.Keyword.DML,
637 # 'STATE': tokens.Keyword,
638 'STATEMENT': tokens.Keyword,
639 'STATIC': tokens.Keyword,
640 'STATISTICS': tokens.Keyword,
641 'STDIN': tokens.Keyword,
642 'STDOUT': tokens.Keyword,
643 'STORAGE': tokens.Keyword,
644 'STRICT': tokens.Keyword,
645 'STRUCTURE': tokens.Keyword,
646 'STYPE': tokens.Keyword,
647 'SUBCLASS_ORIGIN': tokens.Keyword,
648 'SUBLIST': tokens.Keyword,
649 'SUBSTRING': tokens.Keyword,
650 'SUCCESSFUL': tokens.Keyword,
651 'SUM': tokens.Keyword,
652 'SYMMETRIC': tokens.Keyword,
653 'SYNONYM': tokens.Keyword,
654 'SYSID': tokens.Keyword,
655 'SYSTEM': tokens.Keyword,
656 'SYSTEM_USER': tokens.Keyword,
658 'TABLE': tokens.Keyword,
659 'TABLE_NAME': tokens.Keyword,
660 'TEMP': tokens.Keyword,
661 'TEMPLATE': tokens.Keyword,
662 'TEMPORARY': tokens.Keyword,
663 'TERMINATE': tokens.Keyword,
664 'THAN': tokens.Keyword,
665 'TIMESTAMP': tokens.Keyword,
666 'TIMEZONE_HOUR': tokens.Keyword,
667 'TIMEZONE_MINUTE': tokens.Keyword,
668 'TO': tokens.Keyword,
669 'TOAST': tokens.Keyword,
670 'TRAILING': tokens.Keyword,
671 'TRANSATION': tokens.Keyword,
672 'TRANSACTIONS_COMMITTED': tokens.Keyword,
673 'TRANSACTIONS_ROLLED_BACK': tokens.Keyword,
674 'TRANSATION_ACTIVE': tokens.Keyword,
675 'TRANSFORM': tokens.Keyword,
676 'TRANSFORMS': tokens.Keyword,
677 'TRANSLATE': tokens.Keyword,
678 'TRANSLATION': tokens.Keyword,
679 'TREAT': tokens.Keyword,
680 'TRIGGER': tokens.Keyword,
681 'TRIGGER_CATALOG': tokens.Keyword,
682 'TRIGGER_NAME': tokens.Keyword,
683 'TRIGGER_SCHEMA': tokens.Keyword,
684 'TRIM': tokens.Keyword,
685 'TRUE': tokens.Keyword,
686 'TRUSTED': tokens.Keyword,
687 'TYPE': tokens.Keyword,
689 'UID': tokens.Keyword,
690 'UNCOMMITTED': tokens.Keyword,
691 'UNDER': tokens.Keyword,
692 'UNENCRYPTED': tokens.Keyword,
693 'UNION': tokens.Keyword,
694 'UNIQUE': tokens.Keyword,
695 'UNKNOWN': tokens.Keyword,
696 'UNLISTEN': tokens.Keyword,
697 'UNNAMED': tokens.Keyword,
698 'UNNEST': tokens.Keyword,
699 'UNTIL': tokens.Keyword,
700 'UPPER': tokens.Keyword,
701 'USAGE': tokens.Keyword,
702 'USE': tokens.Keyword,
703 'USER': tokens.Keyword,
704 'USER_DEFINED_TYPE_CATALOG': tokens.Keyword,
705 'USER_DEFINED_TYPE_NAME': tokens.Keyword,
706 'USER_DEFINED_TYPE_SCHEMA': tokens.Keyword,
707 'USING': tokens.Keyword,
709 'VACUUM': tokens.Keyword,
710 'VALID': tokens.Keyword,
711 'VALIDATE': tokens.Keyword,
712 'VALIDATOR': tokens.Keyword,
713 'VALUES': tokens.Keyword,
714 'VARIABLE': tokens.Keyword,
715 'VERBOSE': tokens.Keyword,
716 'VERSION': tokens.Keyword,
717 'VIEW': tokens.Keyword,
718 'VOLATILE': tokens.Keyword,
720 'WEEK': tokens.Keyword,
721 'WHENEVER': tokens.Keyword,
722 'WITH': tokens.Keyword.CTE,
723 'WITHOUT': tokens.Keyword,
724 'WORK': tokens.Keyword,
725 'WRITE': tokens.Keyword,
727 'YEAR': tokens.Keyword,
729 'ZONE': tokens.Keyword,
731 # Name.Builtin
732 'ARRAY': tokens.Name.Builtin,
733 'BIGINT': tokens.Name.Builtin,
734 'BINARY': tokens.Name.Builtin,
735 'BIT': tokens.Name.Builtin,
736 'BLOB': tokens.Name.Builtin,
737 'BOOLEAN': tokens.Name.Builtin,
738 'CHAR': tokens.Name.Builtin,
739 'CHARACTER': tokens.Name.Builtin,
740 'DATE': tokens.Name.Builtin,
741 'DEC': tokens.Name.Builtin,
742 'DECIMAL': tokens.Name.Builtin,
743 'FILE_TYPE': tokens.Name.Builtin,
744 'FLOAT': tokens.Name.Builtin,
745 'INT': tokens.Name.Builtin,
746 'INT8': tokens.Name.Builtin,
747 'INTEGER': tokens.Name.Builtin,
748 'INTERVAL': tokens.Name.Builtin,
749 'LONG': tokens.Name.Builtin,
750 'NATURALN': tokens.Name.Builtin,
751 'NVARCHAR': tokens.Name.Builtin,
752 'NUMBER': tokens.Name.Builtin,
753 'NUMERIC': tokens.Name.Builtin,
754 'PLS_INTEGER': tokens.Name.Builtin,
755 'POSITIVE': tokens.Name.Builtin,
756 'POSITIVEN': tokens.Name.Builtin,
757 'REAL': tokens.Name.Builtin,
758 'ROWID': tokens.Name.Builtin,
759 'ROWLABEL': tokens.Name.Builtin,
760 'ROWNUM': tokens.Name.Builtin,
761 'SERIAL': tokens.Name.Builtin,
762 'SERIAL8': tokens.Name.Builtin,
763 'SIGNED': tokens.Name.Builtin,
764 'SIGNTYPE': tokens.Name.Builtin,
765 'SIMPLE_DOUBLE': tokens.Name.Builtin,
766 'SIMPLE_FLOAT': tokens.Name.Builtin,
767 'SIMPLE_INTEGER': tokens.Name.Builtin,
768 'SMALLINT': tokens.Name.Builtin,
769 'SYS_REFCURSOR': tokens.Name.Builtin,
770 'SYSDATE': tokens.Name,
771 'TEXT': tokens.Name.Builtin,
772 'TINYINT': tokens.Name.Builtin,
773 'UNSIGNED': tokens.Name.Builtin,
774 'UROWID': tokens.Name.Builtin,
775 'UTL_FILE': tokens.Name.Builtin,
776 'VARCHAR': tokens.Name.Builtin,
777 'VARCHAR2': tokens.Name.Builtin,
778 'VARYING': tokens.Name.Builtin,
779}
781KEYWORDS_COMMON = {
782 'SELECT': tokens.Keyword.DML,
783 'INSERT': tokens.Keyword.DML,
784 'DELETE': tokens.Keyword.DML,
785 'UPDATE': tokens.Keyword.DML,
786 'UPSERT': tokens.Keyword.DML,
787 'REPLACE': tokens.Keyword.DML,
788 'MERGE': tokens.Keyword.DML,
789 'DROP': tokens.Keyword.DDL,
790 'CREATE': tokens.Keyword.DDL,
791 'ALTER': tokens.Keyword.DDL,
792 'TRUNCATE': tokens.Keyword.DDL,
793 'GRANT': tokens.Keyword.DCL,
794 'REVOKE': tokens.Keyword.DCL,
796 'WHERE': tokens.Keyword,
797 'FROM': tokens.Keyword,
798 'INNER': tokens.Keyword,
799 'JOIN': tokens.Keyword,
800 'STRAIGHT_JOIN': tokens.Keyword,
801 'AND': tokens.Keyword,
802 'OR': tokens.Keyword,
803 'LIKE': tokens.Keyword,
804 'ON': tokens.Keyword,
805 'IN': tokens.Keyword,
806 'SET': tokens.Keyword,
808 'BY': tokens.Keyword,
809 'GROUP': tokens.Keyword,
810 'ORDER': tokens.Keyword,
811 'LEFT': tokens.Keyword,
812 'OUTER': tokens.Keyword,
813 'FULL': tokens.Keyword,
815 'IF': tokens.Keyword,
816 'END': tokens.Keyword,
817 'THEN': tokens.Keyword,
818 'LOOP': tokens.Keyword,
819 'AS': tokens.Keyword,
820 'ELSE': tokens.Keyword,
821 'FOR': tokens.Keyword,
822 'WHILE': tokens.Keyword,
824 'CASE': tokens.Keyword,
825 'WHEN': tokens.Keyword,
826 'MIN': tokens.Keyword,
827 'MAX': tokens.Keyword,
828 'DISTINCT': tokens.Keyword,
829}
831KEYWORDS_ORACLE = {
832 'ARCHIVE': tokens.Keyword,
833 'ARCHIVELOG': tokens.Keyword,
835 'BACKUP': tokens.Keyword,
836 'BECOME': tokens.Keyword,
837 'BLOCK': tokens.Keyword,
838 'BODY': tokens.Keyword,
840 'CANCEL': tokens.Keyword,
841 'CHANGE': tokens.Keyword,
842 'COMPILE': tokens.Keyword,
843 'CONTENTS': tokens.Keyword,
844 'CONTROLFILE': tokens.Keyword,
846 'DATAFILE': tokens.Keyword,
847 'DBA': tokens.Keyword,
848 'DISMOUNT': tokens.Keyword,
849 'DOUBLE': tokens.Keyword,
850 'DUMP': tokens.Keyword,
852 'ELSIF': tokens.Keyword,
853 'EVENTS': tokens.Keyword,
854 'EXCEPTIONS': tokens.Keyword,
855 'EXPLAIN': tokens.Keyword,
856 'EXTENT': tokens.Keyword,
857 'EXTERNALLY': tokens.Keyword,
859 'FLUSH': tokens.Keyword,
860 'FREELIST': tokens.Keyword,
861 'FREELISTS': tokens.Keyword,
863 # groups seems too common as table name
864 # 'GROUPS': tokens.Keyword,
866 'INDICATOR': tokens.Keyword,
867 'INITRANS': tokens.Keyword,
868 'INSTANCE': tokens.Keyword,
870 'LAYER': tokens.Keyword,
871 'LINK': tokens.Keyword,
872 'LISTS': tokens.Keyword,
873 'LOGFILE': tokens.Keyword,
875 'MANAGE': tokens.Keyword,
876 'MANUAL': tokens.Keyword,
877 'MAXDATAFILES': tokens.Keyword,
878 'MAXINSTANCES': tokens.Keyword,
879 'MAXLOGFILES': tokens.Keyword,
880 'MAXLOGHISTORY': tokens.Keyword,
881 'MAXLOGMEMBERS': tokens.Keyword,
882 'MAXTRANS': tokens.Keyword,
883 'MINEXTENTS': tokens.Keyword,
884 'MODULE': tokens.Keyword,
885 'MOUNT': tokens.Keyword,
887 'NOARCHIVELOG': tokens.Keyword,
888 'NOCACHE': tokens.Keyword,
889 'NOCYCLE': tokens.Keyword,
890 'NOMAXVALUE': tokens.Keyword,
891 'NOMINVALUE': tokens.Keyword,
892 'NOORDER': tokens.Keyword,
893 'NORESETLOGS': tokens.Keyword,
894 'NORMAL': tokens.Keyword,
895 'NOSORT': tokens.Keyword,
897 'OPTIMAL': tokens.Keyword,
898 'OWN': tokens.Keyword,
900 'PACKAGE': tokens.Keyword,
901 'PARALLEL': tokens.Keyword,
902 'PCTINCREASE': tokens.Keyword,
903 'PCTUSED': tokens.Keyword,
904 'PLAN': tokens.Keyword,
905 'PRIVATE': tokens.Keyword,
906 'PROFILE': tokens.Keyword,
908 'QUOTA': tokens.Keyword,
910 'RECOVER': tokens.Keyword,
911 'RESETLOGS': tokens.Keyword,
912 'RESTRICTED': tokens.Keyword,
913 'REUSE': tokens.Keyword,
914 'ROLES': tokens.Keyword,
916 'SAVEPOINT': tokens.Keyword,
917 'SCN': tokens.Keyword,
918 'SECTION': tokens.Keyword,
919 'SEGMENT': tokens.Keyword,
920 'SHARED': tokens.Keyword,
921 'SNAPSHOT': tokens.Keyword,
922 'SORT': tokens.Keyword,
923 'STATEMENT_ID': tokens.Keyword,
924 'STOP': tokens.Keyword,
925 'SWITCH': tokens.Keyword,
927 'TABLES': tokens.Keyword,
928 'TABLESPACE': tokens.Keyword,
929 'THREAD': tokens.Keyword,
930 'TIME': tokens.Keyword,
931 'TRACING': tokens.Keyword,
932 'TRANSACTION': tokens.Keyword,
933 'TRIGGERS': tokens.Keyword,
935 'UNLIMITED': tokens.Keyword,
936 'UNLOCK': tokens.Keyword,
937}
939# MySQL
940KEYWORDS_MYSQL = {
941 'ROW': tokens.Keyword,
942}
944# PostgreSQL Syntax
945KEYWORDS_PLPGSQL = {
946 'CONFLICT': tokens.Keyword,
947 'WINDOW': tokens.Keyword,
948 'PARTITION': tokens.Keyword,
949 'ATTACH': tokens.Keyword,
950 'DETACH': tokens.Keyword,
951 'OVER': tokens.Keyword,
952 'PERFORM': tokens.Keyword,
953 'NOTICE': tokens.Keyword,
954 'PLPGSQL': tokens.Keyword,
955 'INHERIT': tokens.Keyword,
956 'INDEXES': tokens.Keyword,
957 'ON_ERROR_STOP': tokens.Keyword,
958 'EXTENSION': tokens.Keyword,
960 'BYTEA': tokens.Keyword,
961 'BIGSERIAL': tokens.Keyword,
962 'BIT VARYING': tokens.Keyword,
963 'BOX': tokens.Keyword,
964 'CHARACTER': tokens.Keyword,
965 'CHARACTER VARYING': tokens.Keyword,
966 'CIDR': tokens.Keyword,
967 'CIRCLE': tokens.Keyword,
968 'DOUBLE PRECISION': tokens.Keyword,
969 'INET': tokens.Keyword,
970 'JSON': tokens.Keyword,
971 'JSONB': tokens.Keyword,
972 'LINE': tokens.Keyword,
973 'LSEG': tokens.Keyword,
974 'MACADDR': tokens.Keyword,
975 'MONEY': tokens.Keyword,
976 'PATH': tokens.Keyword,
977 'PG_LSN': tokens.Keyword,
978 'POINT': tokens.Keyword,
979 'POLYGON': tokens.Keyword,
980 'SMALLSERIAL': tokens.Keyword,
981 'TSQUERY': tokens.Keyword,
982 'TSVECTOR': tokens.Keyword,
983 'TXID_SNAPSHOT': tokens.Keyword,
984 'UUID': tokens.Keyword,
985 'XML': tokens.Keyword,
987 'FOR': tokens.Keyword,
988 'IN': tokens.Keyword,
989 'LOOP': tokens.Keyword,
990}
992# Hive Syntax
993KEYWORDS_HQL = {
994 'EXPLODE': tokens.Keyword,
995 'DIRECTORY': tokens.Keyword,
996 'DISTRIBUTE': tokens.Keyword,
997 'INCLUDE': tokens.Keyword,
998 'LOCATE': tokens.Keyword,
999 'OVERWRITE': tokens.Keyword,
1000 'POSEXPLODE': tokens.Keyword,
1002 'ARRAY_CONTAINS': tokens.Keyword,
1003 'CMP': tokens.Keyword,
1004 'COLLECT_LIST': tokens.Keyword,
1005 'CONCAT': tokens.Keyword,
1006 'CONDITION': tokens.Keyword,
1007 'DATE_ADD': tokens.Keyword,
1008 'DATE_SUB': tokens.Keyword,
1009 'DECODE': tokens.Keyword,
1010 'DBMS_OUTPUT': tokens.Keyword,
1011 'ELEMENTS': tokens.Keyword,
1012 'EXCHANGE': tokens.Keyword,
1013 'EXTENDED': tokens.Keyword,
1014 'FLOOR': tokens.Keyword,
1015 'FOLLOWING': tokens.Keyword,
1016 'FROM_UNIXTIME': tokens.Keyword,
1017 'FTP': tokens.Keyword,
1018 'HOUR': tokens.Keyword,
1019 'INLINE': tokens.Keyword,
1020 'INSTR': tokens.Keyword,
1021 'LEN': tokens.Keyword,
1022 'MAP': tokens.Name.Builtin,
1023 'MAXELEMENT': tokens.Keyword,
1024 'MAXINDEX': tokens.Keyword,
1025 'MAX_PART_DATE': tokens.Keyword,
1026 'MAX_PART_INT': tokens.Keyword,
1027 'MAX_PART_STRING': tokens.Keyword,
1028 'MINELEMENT': tokens.Keyword,
1029 'MININDEX': tokens.Keyword,
1030 'MIN_PART_DATE': tokens.Keyword,
1031 'MIN_PART_INT': tokens.Keyword,
1032 'MIN_PART_STRING': tokens.Keyword,
1033 'NOW': tokens.Keyword,
1034 'NVL': tokens.Keyword,
1035 'NVL2': tokens.Keyword,
1036 'PARSE_URL_TUPLE': tokens.Keyword,
1037 'PART_LOC': tokens.Keyword,
1038 'PART_COUNT': tokens.Keyword,
1039 'PART_COUNT_BY': tokens.Keyword,
1040 'PRINT': tokens.Keyword,
1041 'PUT_LINE': tokens.Keyword,
1042 'RANGE': tokens.Keyword,
1043 'REDUCE': tokens.Keyword,
1044 'REGEXP_REPLACE': tokens.Keyword,
1045 'RESIGNAL': tokens.Keyword,
1046 'RTRIM': tokens.Keyword,
1047 'SIGN': tokens.Keyword,
1048 'SIGNAL': tokens.Keyword,
1049 'SIN': tokens.Keyword,
1050 'SPLIT': tokens.Keyword,
1051 'SQRT': tokens.Keyword,
1052 'STACK': tokens.Keyword,
1053 'STR': tokens.Keyword,
1054 'STRING': tokens.Name.Builtin,
1055 'STRUCT': tokens.Name.Builtin,
1056 'SUBSTR': tokens.Keyword,
1057 'SUMMARY': tokens.Keyword,
1058 'TBLPROPERTIES': tokens.Keyword,
1059 'TIMESTAMP': tokens.Name.Builtin,
1060 'TIMESTAMP_ISO': tokens.Keyword,
1061 'TO_CHAR': tokens.Keyword,
1062 'TO_DATE': tokens.Keyword,
1063 'TO_TIMESTAMP': tokens.Keyword,
1064 'TRUNC': tokens.Keyword,
1065 'UNBOUNDED': tokens.Keyword,
1066 'UNIQUEJOIN': tokens.Keyword,
1067 'UNIX_TIMESTAMP': tokens.Keyword,
1068 'UTC_TIMESTAMP': tokens.Keyword,
1069 'VIEWS': tokens.Keyword,
1071 'EXIT': tokens.Keyword,
1072 'BREAK': tokens.Keyword,
1073 'LEAVE': tokens.Keyword,
1074}
1077KEYWORDS_MSACCESS = {
1078 'DISTINCTROW': tokens.Keyword,
1079}
1082KEYWORDS_SNOWFLAKE = {
1083 'ACCOUNT': tokens.Keyword,
1084 'GSCLUSTER': tokens.Keyword,
1085 'ISSUE': tokens.Keyword,
1086 'ORGANIZATION': tokens.Keyword,
1087 'PIVOT': tokens.Keyword,
1088 'QUALIFY': tokens.Keyword,
1089 'REGEXP': tokens.Keyword,
1090 'RLIKE': tokens.Keyword,
1091 'SAMPLE': tokens.Keyword,
1092 'TRY_CAST': tokens.Keyword,
1093 'UNPIVOT': tokens.Keyword,
1095 'VARIANT': tokens.Name.Builtin,
1096}
1099KEYWORDS_BIGQUERY = {
1100 'ASSERT_ROWS_MODIFIED': tokens.Keyword,
1101 'DEFINE': tokens.Keyword,
1102 'ENUM': tokens.Keyword,
1103 'HASH': tokens.Keyword,
1104 'LOOKUP': tokens.Keyword,
1105 'PRECEDING': tokens.Keyword,
1106 'PROTO': tokens.Keyword,
1107 'RESPECT': tokens.Keyword,
1108 'TABLESAMPLE': tokens.Keyword,
1110 'BIGNUMERIC': tokens.Name.Builtin,
1111}