summaryrefslogtreecommitdiffstats
path: root/sqlglot/generator.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2023-02-20 08:50:35 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2023-02-20 08:50:35 +0000
commit6a22086850fc960715b618e82f4c2e43a4529146 (patch)
tree2005800d79fbd3b3a72ed36d10857fadd61306b7 /sqlglot/generator.py
parentReleasing debian version 11.1.3-1. (diff)
downloadsqlglot-6a22086850fc960715b618e82f4c2e43a4529146.tar.xz
sqlglot-6a22086850fc960715b618e82f4c2e43a4529146.zip
Merging upstream version 11.2.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'sqlglot/generator.py')
-rw-r--r--sqlglot/generator.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/sqlglot/generator.py b/sqlglot/generator.py
index 1479e28..18ae42a 100644
--- a/sqlglot/generator.py
+++ b/sqlglot/generator.py
@@ -84,6 +84,7 @@ class Generator:
exp.CollateColumnConstraint: lambda self, e: f"COLLATE {self.sql(e, 'this')}",
exp.EncodeColumnConstraint: lambda self, e: f"ENCODE {self.sql(e, 'this')}",
exp.DefaultColumnConstraint: lambda self, e: f"DEFAULT {self.sql(e, 'this')}",
+ exp.InlineLengthColumnConstraint: lambda self, e: f"INLINE LENGTH {self.sql(e, 'this')}",
}
# Whether 'CREATE ... TRANSIENT ... TABLE' is allowed
@@ -445,6 +446,14 @@ class Generator:
def autoincrementcolumnconstraint_sql(self, _) -> str:
return self.token_sql(TokenType.AUTO_INCREMENT)
+ def compresscolumnconstraint_sql(self, expression: exp.CompressColumnConstraint) -> str:
+ if isinstance(expression.this, list):
+ this = self.wrap(self.expressions(expression, key="this", flat=True))
+ else:
+ this = self.sql(expression, "this")
+
+ return f"COMPRESS {this}"
+
def generatedasidentitycolumnconstraint_sql(
self, expression: exp.GeneratedAsIdentityColumnConstraint
) -> str: