Skip to content

Commit

Permalink
Merge pull request DerekStride#255 from guilhas07/main
Browse files Browse the repository at this point in the history
Add if_not_exists optional rule to create database
  • Loading branch information
matthias-Q authored Jun 3, 2024
2 parents 7d591a1 + 0c08b73 commit 7349144
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
1 change: 1 addition & 0 deletions grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -1392,6 +1392,7 @@ module.exports = grammar({
create_database: $ => seq(
$.keyword_create,
$.keyword_database,
optional($._if_not_exists),
$.identifier,
optional($.keyword_with),
repeat(
Expand Down
18 changes: 18 additions & 0 deletions test/corpus/create.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1937,6 +1937,24 @@ CREATE DATABASE hollywood
(keyword_database)
(identifier))))

================================================================================
Create database if not exists
================================================================================

CREATE DATABASE IF NOT EXISTS hollywood

--------------------------------------------------------------------------------

(program
(statement
(create_database
(keyword_create)
(keyword_database)
(keyword_if)
(keyword_not)
(keyword_exists)
(identifier))))

================================================================================
Create database with settings
================================================================================
Expand Down

0 comments on commit 7349144

Please sign in to comment.