diff options
Diffstat (limited to '')
-rw-r--r-- | sqlglot/dialects/dialect.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/sqlglot/dialects/dialect.py b/sqlglot/dialects/dialect.py index ccf04da..bd839af 100644 --- a/sqlglot/dialects/dialect.py +++ b/sqlglot/dialects/dialect.py @@ -81,6 +81,8 @@ class _Dialect(type): klass.INVERSE_TIME_MAPPING = {v: k for k, v in klass.TIME_MAPPING.items()} klass.INVERSE_TIME_TRIE = new_trie(klass.INVERSE_TIME_MAPPING) + klass.INVERSE_ESCAPE_SEQUENCES = {v: k for k, v in klass.ESCAPE_SEQUENCES.items()} + klass.tokenizer_class = getattr(klass, "Tokenizer", Tokenizer) klass.parser_class = getattr(klass, "Parser", Parser) klass.generator_class = getattr(klass, "Generator", Generator) @@ -188,6 +190,9 @@ class Dialect(metaclass=_Dialect): # special syntax cast(x as date format 'yyyy') defaults to time_mapping FORMAT_MAPPING: t.Dict[str, str] = {} + # Mapping of an unescaped escape sequence to the corresponding character + ESCAPE_SEQUENCES: t.Dict[str, str] = {} + # Columns that are auto-generated by the engine corresponding to this dialect # Such columns may be excluded from SELECT * queries, for example PSEUDOCOLUMNS: t.Set[str] = set() @@ -204,6 +209,8 @@ class Dialect(metaclass=_Dialect): INVERSE_TIME_MAPPING: t.Dict[str, str] = {} INVERSE_TIME_TRIE: t.Dict = {} + INVERSE_ESCAPE_SEQUENCES: t.Dict[str, str] = {} + def __eq__(self, other: t.Any) -> bool: return type(self) == other @@ -245,7 +252,7 @@ class Dialect(metaclass=_Dialect): """ Normalizes an unquoted identifier to either lower or upper case, thus essentially making it case-insensitive. If a dialect treats all identifiers as case-insensitive, - they will be normalized regardless of being quoted or not. + they will be normalized to lowercase regardless of being quoted or not. """ if isinstance(expression, exp.Identifier) and ( not expression.quoted or cls.RESOLVES_IDENTIFIERS_AS_UPPERCASE is None |