Adding upstream version 23.7.0.
Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
parent
f1aa09959c
commit
27c061b7af
187 changed files with 86502 additions and 71397 deletions
|
@ -278,6 +278,7 @@ class Postgres(Dialect):
|
|||
"REVOKE": TokenType.COMMAND,
|
||||
"SERIAL": TokenType.SERIAL,
|
||||
"SMALLSERIAL": TokenType.SMALLSERIAL,
|
||||
"NAME": TokenType.NAME,
|
||||
"TEMP": TokenType.TEMPORARY,
|
||||
"CSTRING": TokenType.PSEUDO_TYPE,
|
||||
"OID": TokenType.OBJECT_IDENTIFIER,
|
||||
|
@ -356,6 +357,16 @@ class Postgres(Dialect):
|
|||
|
||||
JSON_ARROWS_REQUIRE_JSON_TYPE = True
|
||||
|
||||
COLUMN_OPERATORS = {
|
||||
**parser.Parser.COLUMN_OPERATORS,
|
||||
TokenType.ARROW: lambda self, this, path: build_json_extract_path(
|
||||
exp.JSONExtract, arrow_req_json_type=self.JSON_ARROWS_REQUIRE_JSON_TYPE
|
||||
)([this, path]),
|
||||
TokenType.DARROW: lambda self, this, path: build_json_extract_path(
|
||||
exp.JSONExtractScalar, arrow_req_json_type=self.JSON_ARROWS_REQUIRE_JSON_TYPE
|
||||
)([this, path]),
|
||||
}
|
||||
|
||||
def _parse_operator(self, this: t.Optional[exp.Expression]) -> t.Optional[exp.Expression]:
|
||||
while True:
|
||||
if not self._match(TokenType.L_PAREN):
|
||||
|
@ -484,6 +495,7 @@ class Postgres(Dialect):
|
|||
]
|
||||
),
|
||||
exp.StrPosition: str_position_sql,
|
||||
exp.StrToDate: lambda self, e: self.func("TO_DATE", e.this, self.format_time(e)),
|
||||
exp.StrToTime: lambda self, e: self.func("TO_TIMESTAMP", e.this, self.format_time(e)),
|
||||
exp.StructExtract: struct_extract_sql,
|
||||
exp.Substring: _substring_sql,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue