Adding upstream version 26.12.0.
Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
parent
aa70b5e889
commit
4118582692
70 changed files with 1134 additions and 340 deletions
|
@ -3067,6 +3067,11 @@ class UnloggedProperty(Property):
|
|||
arg_types = {}
|
||||
|
||||
|
||||
# https://docs.snowflake.com/en/sql-reference/sql/create-table#create-table-using-template
|
||||
class UsingTemplateProperty(Property):
|
||||
arg_types = {"this": True}
|
||||
|
||||
|
||||
# https://learn.microsoft.com/en-us/sql/t-sql/statements/create-view-transact-sql?view=sql-server-ver16
|
||||
class ViewAttributeProperty(Property):
|
||||
arg_types = {"this": True}
|
||||
|
@ -7012,7 +7017,7 @@ def maybe_copy(instance, copy=True):
|
|||
return instance.copy() if copy and instance else instance
|
||||
|
||||
|
||||
def _to_s(node: t.Any, verbose: bool = False, level: int = 0) -> str:
|
||||
def _to_s(node: t.Any, verbose: bool = False, level: int = 0, repr_str: bool = False) -> str:
|
||||
"""Generate a textual representation of an Expression tree"""
|
||||
indent = "\n" + (" " * (level + 1))
|
||||
delim = f",{indent}"
|
||||
|
@ -7033,7 +7038,10 @@ def _to_s(node: t.Any, verbose: bool = False, level: int = 0) -> str:
|
|||
indent = ""
|
||||
delim = ", "
|
||||
|
||||
items = delim.join([f"{k}={_to_s(v, verbose, level + 1)}" for k, v in args.items()])
|
||||
repr_str = node.is_string or (isinstance(node, Identifier) and node.quoted)
|
||||
items = delim.join(
|
||||
[f"{k}={_to_s(v, verbose, level + 1, repr_str=repr_str)}" for k, v in args.items()]
|
||||
)
|
||||
return f"{node.__class__.__name__}({indent}{items})"
|
||||
|
||||
if isinstance(node, list):
|
||||
|
@ -7041,6 +7049,10 @@ def _to_s(node: t.Any, verbose: bool = False, level: int = 0) -> str:
|
|||
items = f"{indent}{items}" if items else ""
|
||||
return f"[{items}]"
|
||||
|
||||
# We use the representation of the string to avoid stripping out important whitespace
|
||||
if repr_str and isinstance(node, str):
|
||||
node = repr(node)
|
||||
|
||||
# Indent multiline strings to match the current level
|
||||
return indent.join(textwrap.dedent(str(node).strip("\n")).splitlines())
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue