diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-02-20 08:50:30 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-02-20 08:50:30 +0000 |
commit | cc4c7716b8fe6b13bf735ab1ccbc1a92ded4d6d5 (patch) | |
tree | 3723d527945944e4fed74f7fe9da43407349351a /sqlglot/parser.py | |
parent | Adding upstream version 11.1.3. (diff) | |
download | sqlglot-cc4c7716b8fe6b13bf735ab1ccbc1a92ded4d6d5.tar.xz sqlglot-cc4c7716b8fe6b13bf735ab1ccbc1a92ded4d6d5.zip |
Adding upstream version 11.2.0.upstream/11.2.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'sqlglot/parser.py')
-rw-r--r-- | sqlglot/parser.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/sqlglot/parser.py b/sqlglot/parser.py index 9bde696..f92f5ac 100644 --- a/sqlglot/parser.py +++ b/sqlglot/parser.py @@ -594,6 +594,7 @@ class Parser(metaclass=_Parser): "COMMENT": lambda self: self.expression( exp.CommentColumnConstraint, this=self._parse_string() ), + "COMPRESS": lambda self: self._parse_compress(), "DEFAULT": lambda self: self.expression( exp.DefaultColumnConstraint, this=self._parse_bitwise() ), @@ -604,6 +605,7 @@ class Parser(metaclass=_Parser): ), "GENERATED": lambda self: self._parse_generated_as_identity(), "IDENTITY": lambda self: self._parse_auto_increment(), + "INLINE": lambda self: self._parse_inline(), "LIKE": lambda self: self._parse_create_like(), "NOT": lambda self: self._parse_not_constraint(), "NULL": lambda self: self.expression(exp.NotNullColumnConstraint, allow_null=True), @@ -2882,6 +2884,14 @@ class Parser(metaclass=_Parser): return exp.AutoIncrementColumnConstraint() + def _parse_compress(self) -> exp.Expression: + if self._match(TokenType.L_PAREN, advance=False): + return self.expression( + exp.CompressColumnConstraint, this=self._parse_wrapped_csv(self._parse_bitwise) + ) + + return self.expression(exp.CompressColumnConstraint, this=self._parse_bitwise()) + def _parse_generated_as_identity(self) -> exp.Expression: if self._match(TokenType.BY_DEFAULT): this = self.expression(exp.GeneratedAsIdentityColumnConstraint, this=False) @@ -2909,6 +2919,10 @@ class Parser(metaclass=_Parser): return this + def _parse_inline(self) -> t.Optional[exp.Expression]: + self._match_text_seq("LENGTH") + return self.expression(exp.InlineLengthColumnConstraint, this=self._parse_bitwise()) + def _parse_not_constraint(self) -> t.Optional[exp.Expression]: if self._match_text_seq("NULL"): return self.expression(exp.NotNullColumnConstraint) |