1
0
Fork 0

Adding upstream version 25.7.1.

Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
Daniel Baumann 2025-02-13 21:51:31 +01:00
parent f9dae8e951
commit 8356f462bb
Signed by: daniel
GPG key ID: FBB4F0E80A80222F
102 changed files with 52995 additions and 52070 deletions

View file

@ -1027,6 +1027,14 @@ class Generator(metaclass=_Generator):
replace = " OR REPLACE" if expression.args.get("replace") else ""
unique = " UNIQUE" if expression.args.get("unique") else ""
clustered = expression.args.get("clustered")
if clustered is None:
clustered_sql = ""
elif clustered:
clustered_sql = " CLUSTERED COLUMNSTORE"
else:
clustered_sql = " NONCLUSTERED COLUMNSTORE"
postcreate_props_sql = ""
if properties_locs.get(exp.Properties.Location.POST_CREATE):
postcreate_props_sql = self.properties(
@ -1036,7 +1044,7 @@ class Generator(metaclass=_Generator):
wrapped=False,
)
modifiers = "".join((replace, unique, postcreate_props_sql))
modifiers = "".join((clustered_sql, replace, unique, postcreate_props_sql))
postexpression_props_sql = ""
if properties_locs.get(exp.Properties.Location.POST_EXPRESSION):
@ -1049,6 +1057,7 @@ class Generator(metaclass=_Generator):
wrapped=False,
)
concurrently = " CONCURRENTLY" if expression.args.get("concurrently") else ""
exists_sql = " IF NOT EXISTS" if expression.args.get("exists") else ""
no_schema_binding = (
" WITH NO SCHEMA BINDING" if expression.args.get("no_schema_binding") else ""
@ -1057,7 +1066,7 @@ class Generator(metaclass=_Generator):
clone = self.sql(expression, "clone")
clone = f" {clone}" if clone else ""
expression_sql = f"CREATE{modifiers} {kind}{exists_sql} {this}{properties_sql}{expression_sql}{postexpression_props_sql}{index_sql}{no_schema_binding}{clone}"
expression_sql = f"CREATE{modifiers} {kind}{concurrently}{exists_sql} {this}{properties_sql}{expression_sql}{postexpression_props_sql}{index_sql}{no_schema_binding}{clone}"
return self.prepend_ctes(expression, expression_sql)
def sequenceproperties_sql(self, expression: exp.SequenceProperties) -> str:
@ -1734,8 +1743,7 @@ class Generator(metaclass=_Generator):
alias = f"{sep}{alias}" if alias else ""
hints = self.expressions(expression, key="hints", sep=" ")
hints = f" {hints}" if hints and self.TABLE_HINTS else ""
pivots = self.expressions(expression, key="pivots", sep=" ", flat=True)
pivots = f" {pivots}" if pivots else ""
pivots = self.expressions(expression, key="pivots", sep="", flat=True)
joins = self.indent(
self.expressions(expression, key="joins", sep="", flat=True), skip_first=True
)
@ -1822,7 +1830,7 @@ class Generator(metaclass=_Generator):
alias = self.sql(expression, "alias")
alias = f" AS {alias}" if alias else ""
direction = "UNPIVOT" if expression.unpivot else "PIVOT"
direction = self.seg("UNPIVOT" if expression.unpivot else "PIVOT")
field = self.sql(expression, "field")
include_nulls = expression.args.get("include_nulls")
if include_nulls is not None:
@ -2409,10 +2417,7 @@ class Generator(metaclass=_Generator):
def subquery_sql(self, expression: exp.Subquery, sep: str = " AS ") -> str:
alias = self.sql(expression, "alias")
alias = f"{sep}{alias}" if alias else ""
pivots = self.expressions(expression, key="pivots", sep=" ", flat=True)
pivots = f" {pivots}" if pivots else ""
pivots = self.expressions(expression, key="pivots", sep="", flat=True)
sql = self.query_modifiers(expression, self.wrap(expression), alias, pivots)
return self.prepend_ctes(expression, sql)
@ -3134,6 +3139,7 @@ class Generator(metaclass=_Generator):
expression,
key="actions",
prefix="ADD COLUMN ",
skip_first=True,
)
return f"ADD {self.expressions(expression, key='actions', flat=True)}"