File tree Expand file tree Collapse file tree 2 files changed +3
-0
lines changed
Expand file tree Collapse file tree 2 files changed +3
-0
lines changed Original file line number Diff line number Diff line change @@ -805,6 +805,7 @@ class Parser(metaclass=_Parser):
805805 EXPRESSION_PARSERS = {
806806 exp .Cluster : lambda self : self ._parse_sort (exp .Cluster , TokenType .CLUSTER_BY ),
807807 exp .Column : lambda self : self ._parse_column (),
808+ exp .ColumnDef : lambda self : self ._parse_column_def (self ._parse_column ()),
808809 exp .Condition : lambda self : self ._parse_assignment (),
809810 exp .DataType : lambda self : self ._parse_types (allow_identifiers = False , schema = True ),
810811 exp .Expression : lambda self : self ._parse_expression (),
Original file line number Diff line number Diff line change @@ -40,6 +40,8 @@ def test_parse_into(self):
4040 "Failed to parse 'SELECT * FROM tbl' into <class 'sqlglot.expressions.Table'>" ,
4141 )
4242
43+ self .assertIsInstance (parse_one ("foo INT NOT NULL" , into = exp .ColumnDef ), exp .ColumnDef )
44+
4345 def test_parse_into_error (self ):
4446 expected_message = "Failed to parse 'SELECT 1;' into [<class 'sqlglot.expressions.From'>]"
4547 expected_errors = [
You can’t perform that action at this time.
0 commit comments