Skip to content

Commit

Permalink
Merge pull request m-novikov#80 from LeoniePhiline/feat/optional-alte…
Browse files Browse the repository at this point in the history
…r-column

feat: Optional `COLUMN` in `ALTER TABLE` for `ADD`, `CHANGE` and `DROP`
  • Loading branch information
DerekStride authored Feb 3, 2023
2 parents 30e15d4 + bd25587 commit c508e60
Show file tree
Hide file tree
Showing 4 changed files with 91,649 additions and 90,927 deletions.
12 changes: 9 additions & 3 deletions grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -660,15 +660,19 @@ module.exports = grammar({

add_column: $ => seq(
$.keyword_add,
$.keyword_column,
optional(
$.keyword_column,
),
optional($._if_not_exists),
$.column_definition,
),

alter_column: $ => seq(
// TODO constraint management
$.keyword_alter,
$.keyword_column,
optional(
$.keyword_column,
),
field('name', $.identifier),
choice(
seq(
Expand Down Expand Up @@ -703,7 +707,9 @@ module.exports = grammar({

drop_column: $ => seq(
$.keyword_drop,
$.keyword_column,
optional(
$.keyword_column,
),
optional($._if_exists),
field('name', $.identifier),
),
Expand Down
36 changes: 30 additions & 6 deletions src/grammar.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit c508e60

Please sign in to comment.