DerekStride / tree-sitter-sql

SQL grammar for tree-sitter
http://derek.stride.host/tree-sitter-sql/
MIT License
147 stars 47 forks source link

UNIQUE constraint not parsed correctly #249

Closed guilhas07 closed 4 months ago

guilhas07 commented 4 months ago

I believe the following should be valid sql, but as you can see it isn't correctly parsed:

CREATE TABLE test (
    name TEXT UNIQUE
);
  (statement ; [0, 0] - [2, 1]
    (create_table ; [0, 0] - [2, 1]
      (keyword_create) ; [0, 0] - [0, 6]
      (keyword_table) ; [0, 7] - [0, 12]
      (object_reference ; [0, 13] - [0, 17]
        name: (identifier)) ; [0, 13] - [0, 17]
      (column_definitions ; [0, 18] - [2, 1]
        (column_definition ; [1, 4] - [1, 13]
          name: (identifier) ; [1, 4] - [1, 8]
          type: (keyword_text)) ; [1, 9] - [1, 13]
        (ERROR))))) ; [1, 14] - [1, 20]