Edit on GitHub

sqlglot.dialects.materialize

 1from __future__ import annotations
 2
 3from sqlglot.dialects.postgres import Postgres
 4from sqlglot.generators.materialize import MaterializeGenerator
 5from sqlglot.parsers.materialize import MaterializeParser
 6
 7
 8class Materialize(Postgres):
 9    Parser = MaterializeParser
10
11    Generator = MaterializeGenerator
class Materialize(sqlglot.dialects.postgres.Postgres):
 9class Materialize(Postgres):
10    Parser = MaterializeParser
11
12    Generator = MaterializeGenerator
SUPPORTS_COLUMN_JOIN_MARKS = False

Whether the old-style outer join (+) syntax is supported.

STRINGS_SUPPORT_ESCAPED_SEQUENCES: bool = False

Whether string literals support escape sequences (e.g. \n). Set by the metaclass based on the tokenizer's STRING_ESCAPES.

BYTE_STRINGS_SUPPORT_ESCAPED_SEQUENCES: bool = False

Whether byte string literals support escape sequences. Set by the metaclass based on the tokenizer's BYTE_STRING_ESCAPES.

INITCAP_SUPPORTS_CUSTOM_DELIMITERS = False
tokenizer_class = <class 'sqlglot.dialects.dialect.Tokenizer'>
jsonpath_tokenizer_class = <class 'sqlglot.dialects.dialect.JSONPathTokenizer'>
TIME_TRIE: dict = {'d': {0: True, 'd': {0: True, 'd': {0: True}}}, 'D': {0: True, 'D': {0: True, 'D': {0: True}}}, 'F': {'M': {'D': {'D': {0: True, 'D': {0: True}}}, 'H': {'H': {'1': {'2': {0: True}}, '2': {'4': {0: True}}}}, 'M': {'I': {0: True}, 'M': {0: True}}, 'S': {'S': {0: True}}}}, 'H': {'H': {'1': {'2': {0: True}}, '2': {'4': {0: True}}}}, 'm': {'i': {0: True}, 'm': {0: True}}, 'M': {'I': {0: True}, 'M': {0: True}}, 'O': {'F': {0: True}}, 's': {'s': {0: True}}, 'S': {'S': {0: True}}, 'T': {'M': {'D': {'a': {'y': {0: True}}, 'y': {0: True}}, 'M': {'o': {'n': {0: True, 't': {'h': {0: True}}}}}}, 'Z': {0: True}}, 'U': {'S': {0: True}}, 'w': {'w': {0: True}}, 'W': {'W': {0: True}}, 'y': {'y': {0: True, 'y': {'y': {0: True}}}}, 'Y': {'Y': {0: True, 'Y': {'Y': {0: True}}}}}
FORMAT_TRIE: dict = {'d': {0: True, 'd': {0: True, 'd': {0: True}}}, 'D': {0: True, 'D': {0: True, 'D': {0: True}}}, 'F': {'M': {'D': {'D': {0: True, 'D': {0: True}}}, 'H': {'H': {'1': {'2': {0: True}}, '2': {'4': {0: True}}}}, 'M': {'I': {0: True}, 'M': {0: True}}, 'S': {'S': {0: True}}}}, 'H': {'H': {'1': {'2': {0: True}}, '2': {'4': {0: True}}}}, 'm': {'i': {0: True}, 'm': {0: True}}, 'M': {'I': {0: True}, 'M': {0: True}}, 'O': {'F': {0: True}}, 's': {'s': {0: True}}, 'S': {'S': {0: True}}, 'T': {'M': {'D': {'a': {'y': {0: True}}, 'y': {0: True}}, 'M': {'o': {'n': {0: True, 't': {'h': {0: True}}}}}}, 'Z': {0: True}}, 'U': {'S': {0: True}}, 'w': {'w': {0: True}}, 'W': {'W': {0: True}}, 'y': {'y': {0: True, 'y': {'y': {0: True}}}}, 'Y': {'Y': {0: True, 'Y': {'Y': {0: True}}}}}
INVERSE_TIME_MAPPING: dict[str, str] = {'%u': 'D', '%d': 'DD', '%j': 'DDD', '%-d': 'FMDD', '%-j': 'FMDDD', '%-I': 'FMHH12', '%-H': 'FMHH24', '%-M': 'FMMI', '%-m': 'FMMM', '%-S': 'FMSS', '%I': 'HH12', '%H': 'HH24', '%M': 'MI', '%m': 'MM', '%z': 'OF', '%S': 'SS', '%A': 'TMDay', '%a': 'TMDy', '%b': 'TMMon', '%B': 'TMMonth', '%Z': 'TZ', '%f': 'US', '%U': 'WW', '%y': 'YY', '%Y': 'YYYY'}
INVERSE_TIME_TRIE: dict = {'%': {'u': {0: True}, 'd': {0: True}, 'j': {0: True}, '-': {'d': {0: True}, 'j': {0: True}, 'I': {0: True}, 'H': {0: True}, 'M': {0: True}, 'm': {0: True}, 'S': {0: True}}, 'I': {0: True}, 'H': {0: True}, 'M': {0: True}, 'm': {0: True}, 'z': {0: True}, 'S': {0: True}, 'A': {0: True}, 'a': {0: True}, 'b': {0: True}, 'B': {0: True}, 'Z': {0: True}, 'f': {0: True}, 'U': {0: True}, 'y': {0: True}, 'Y': {0: True}}}
INVERSE_FORMAT_MAPPING: dict[str, str] = {}
INVERSE_FORMAT_TRIE: dict = {}
INVERSE_CREATABLE_KIND_MAPPING: dict[str, str] = {}
ESCAPED_SEQUENCES: dict[str, str] = {'\x07': '\\a', '\x08': '\\b', '\x0c': '\\f', '\n': '\\n', '\r': '\\r', '\t': '\\t', '\x0b': '\\v', '\\': '\\\\'}
QUOTE_START = "'"
QUOTE_END = "'"
IDENTIFIER_START = '"'
IDENTIFIER_END = '"'
VALID_INTERVAL_UNITS: set[str] = {'DAYOFYEAR', 'H', 'MICROSEC', 'NSECONDS', 'S', 'MONTHS', 'DEC', 'EPOCH_SECOND', 'WEEKOFYEAR', 'CENTS', 'DW', 'QUARTERS', 'WEEKDAY_ISO', 'DECADE', 'NANOSEC', 'CENTURY', 'EPOCH', 'MSECS', 'M', 'DAYOFWEEK', 'WEEKDAY', 'CENTURIES', 'MILS', 'MI', 'DAYOFWEEKISO', 'MONTH', 'HOURS', 'DOW_ISO', 'WEEK_ISO', 'SEC', 'NSECOND', 'DAY', 'HH', 'MSEC', 'EPOCH_MICROSECONDS', 'CENT', 'DAYOFWEEK_ISO', 'YYY', 'YEAR', 'USECOND', 'C', 'EPOCH_SECONDS', 'YR', 'MIN', 'NSEC', 'WY', 'USECS', 'WEEKOFYEAR_ISO', 'DAY OF YEAR', 'YEARS', 'NANOSECOND', 'QTR', 'DOW', 'WEEKISO', 'EPOCH_MICROSECOND', 'DY', 'MILLISEC', 'MM', 'W', 'WEEK', 'SECONDS', 'NANOSECS', 'MILLISECON', 'SECOND', 'USECONDS', 'D', 'US', 'EPOCH_NANOSECONDS', 'Y', 'NS', 'EPOCH_NANOSECOND', 'YYYY', 'DW_ISO', 'DAYOFMONTH', 'QUARTER', 'MON', 'Q', 'MIL', 'MONS', 'WOY', 'WEEKOFYEARISO', 'MINUTE', 'YY', 'USEC', 'YRS', 'MILLISECONDS', 'MILLENNIUM', 'TIMEZONE_MINUTE', 'HR', 'HOUR', 'MICROSECONDS', 'EPOCH_MILLISECONDS', 'MILLISECOND', 'MILLISECS', 'MINS', 'MSECOND', 'WK', 'MSECONDS', 'DD', 'TIMEZONE_HOUR', 'TZM', 'MICROSECOND', 'MINUTES', 'DECS', 'QTRS', 'MS', 'TZH', 'MICROSECS', 'EPOCH_MILLISECOND', 'DECADES', 'HRS', 'DAY OF WEEK', 'SECS', 'DAYS', 'DOY', 'MILLENIA'}
BIT_START: str | None = "b'"
BIT_END: str | None = "'"
HEX_START: str | None = "x'"
HEX_END: str | None = "'"
BYTE_START: str | None = "e'"
BYTE_END: str | None = "'"
UNICODE_START: str | None = None
UNICODE_END: str | None = None