tree-sitter-sql
tree-sitter-sql copied to clipboard
Adding suport for AUTOINCREMENT keyword from SQLite
When creating a table in SQLite, the AUTOINCREMENT keyword can be used as a column constraint when it is the primary key.
In the current implementation, this keyword does not exist, as the MySQL implementation uses AUTO_INCREMENT, with an underscore.
I'm new to Treesitter but I think it comes down to adding a new keyword in line 154
keyword_autoincrement: _ => make_keyword("autoincrement"),
and replacing line 2717 with a choice for the keywords in the _column_constraint function
choice($.keyword_auto_increment, $.keyword_autoincrement),
It's also possible to update the existing keyword_autoincrement to be a choice between the two options:
keyword_autoincrement: _ => choice(make_keyword("autoincrement"), make_keyword("autoincrement")),