1
0
Fork 0

Adding upstream version 26.0.0.

Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
Daniel Baumann 2025-02-13 21:58:31 +01:00
parent 2ebe732d69
commit 522374f608
Signed by: daniel
GPG key ID: FBB4F0E80A80222F
57 changed files with 26226 additions and 25977 deletions

View file

@ -2113,7 +2113,7 @@ class Directory(Expression):
class ForeignKey(Expression):
arg_types = {
"expressions": True,
"expressions": False,
"reference": False,
"delete": False,
"update": False,
@ -4347,6 +4347,7 @@ class DataType(Expression):
DATEMULTIRANGE = auto()
DATERANGE = auto()
DATETIME = auto()
DATETIME2 = auto()
DATETIME64 = auto()
DECIMAL = auto()
DECIMAL32 = auto()
@ -4406,6 +4407,7 @@ class DataType(Expression):
ROWVERSION = auto()
SERIAL = auto()
SET = auto()
SMALLDATETIME = auto()
SMALLINT = auto()
SMALLMONEY = auto()
SMALLSERIAL = auto()
@ -4529,7 +4531,9 @@ class DataType(Expression):
Type.DATE,
Type.DATE32,
Type.DATETIME,
Type.DATETIME2,
Type.DATETIME64,
Type.SMALLDATETIME,
Type.TIME,
Type.TIMESTAMP,
Type.TIMESTAMPNTZ,
@ -6678,16 +6682,22 @@ class Merge(DML):
"this": True,
"using": True,
"on": True,
"expressions": True,
"whens": True,
"with": False,
"returning": False,
}
class When(Func):
class When(Expression):
arg_types = {"matched": True, "source": False, "condition": False, "then": True}
class Whens(Expression):
"""Wraps around one or more WHEN [NOT] MATCHED [...] clauses."""
arg_types = {"expressions": True}
# https://docs.oracle.com/javadb/10.8.3.0/ref/rrefsqljnextvaluefor.html
# https://learn.microsoft.com/en-us/sql/t-sql/functions/next-value-for-transact-sql?view=sql-server-ver16
class NextValueFor(Func):
@ -7345,14 +7355,17 @@ def merge(
Returns:
Merge: The syntax tree for the MERGE statement.
"""
expressions = []
for when_expr in when_exprs:
expressions.extend(
maybe_parse(when_expr, dialect=dialect, copy=copy, into=Whens, **opts).expressions
)
merge = Merge(
this=maybe_parse(into, dialect=dialect, copy=copy, **opts),
using=maybe_parse(using, dialect=dialect, copy=copy, **opts),
on=maybe_parse(on, dialect=dialect, copy=copy, **opts),
expressions=[
maybe_parse(when_expr, dialect=dialect, copy=copy, into=When, **opts)
for when_expr in when_exprs
],
whens=Whens(expressions=expressions),
)
if returning:
merge = merge.returning(returning, dialect=dialect, copy=False, **opts)