Skip to content

Commit

Permalink
add full outer joins
Browse files Browse the repository at this point in the history
  • Loading branch information
matthias-Q committed Mar 29, 2023
1 parent 89a01df commit ebf4e65
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 1 deletion.
3 changes: 3 additions & 0 deletions grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ module.exports = grammar({
keyword_left: _ => make_keyword("left"),
keyword_right: _ => make_keyword("right"),
keyword_inner: _ => make_keyword("inner"),
keyword_full: _ => make_keyword("full"),
keyword_outer: _ => make_keyword("outer"),
keyword_cross: _ => make_keyword("cross"),
keyword_join: _ => make_keyword("join"),
Expand Down Expand Up @@ -1677,10 +1678,12 @@ module.exports = grammar({
choice(
$.keyword_cross,
$.keyword_left,
seq($.keyword_full, $.keyword_outer),
seq($.keyword_left, $.keyword_outer),
$.keyword_right,
seq($.keyword_right, $.keyword_outer),
$.keyword_inner,
$.keyword_full,
),
),
$.keyword_join,
Expand Down
37 changes: 36 additions & 1 deletion test/corpus/select.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1056,7 +1056,11 @@ ON a.id = d.d_id
RIGHT OUTER JOIN table_d d
ON a.id = d.d_id
INNER JOIN table_e e
ON a.id = e.e_id;
ON a.id = e.e_id
FULL OUTER JOIN table_f f
ON a.id = f.f_id
FULL JOIN table_g g
ON a.id = g.g_id;

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

Expand Down Expand Up @@ -1145,6 +1149,37 @@ ON a.id = e.e_id;
name: (identifier))
table_alias: (identifier))
(keyword_on)
predicate: (binary_expression
left: (field
table_alias: (identifier)
name: (identifier))
right: (field
table_alias: (identifier)
name: (identifier))))
(join
(keyword_full)
(keyword_outer)
(keyword_join)
(relation
(table_reference
name: (identifier))
table_alias: (identifier))
(keyword_on)
predicate: (binary_expression
left: (field
table_alias: (identifier)
name: (identifier))
right: (field
table_alias: (identifier)
name: (identifier))))
(join
(keyword_full)
(keyword_join)
(relation
(table_reference
name: (identifier))
table_alias: (identifier))
(keyword_on)
predicate: (binary_expression
left: (field
table_alias: (identifier)
Expand Down

0 comments on commit ebf4e65

Please sign in to comment.