Skip to content

Commit

Permalink
Merge pull request #2170 from taozhi8833998/fix-except-noql
Browse files Browse the repository at this point in the history
fix: except op in noql
  • Loading branch information
taozhi8833998 authored Oct 13, 2024
2 parents a2124c3 + b843ba1 commit ef7aa9e
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 4 deletions.
1 change: 1 addition & 0 deletions pegjs/bigquery.pegjs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
'END': true,
'EXISTS': true,
'EXPLAIN': true,
'EXCEPT': true,

'FALSE': true,
'FROM': true,
Expand Down
1 change: 1 addition & 0 deletions pegjs/noql.pegjs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
'END': true,
'EXISTS': true,
'EXPLAIN': true,
'EXCEPT': true,

'FALSE': true,
'FROM': true,
Expand Down
1 change: 1 addition & 0 deletions pegjs/postgresql.pegjs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
'END': true,
'EXISTS': true,
'EXPLAIN': true,
'EXCEPT': true,

'FALSE': true,
'FROM': true,
Expand Down
1 change: 1 addition & 0 deletions pegjs/redshift.pegjs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
'END': true,
'EXISTS': true,
'EXPLAIN': true,
'EXCEPT': true,

'FALSE': true,
'FROM': true,
Expand Down
13 changes: 9 additions & 4 deletions test/noql.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,17 @@ describe('noql', () => {
expect(getParsedSql(sql)).to.be.equal(`SELECT *, convert("Replacement Cost", 'int') AS "s" FROM "films"`)
})

it('should support intersect', () => {
const sql = `SELECT *
it('should support except and intersect', () => {
let sql = `SELECT *
FROM "top-rated-films"
EXCEPT
SELECT *
FROM "most-popular-films"
ORDER BY name`
expect(getParsedSql(sql)).to.be.equal('SELECT * FROM "top-rated-films" EXCEPT SELECT * FROM "most-popular-films" ORDER BY "name" ASC')
sql = `SELECT *
FROM "most-popular-films"
INTERSECT
SELECT *
FROM "top-rated-films"`
expect(getParsedSql(sql)).to.be.equal('SELECT * FROM "most-popular-films" INTERSECT SELECT * FROM "top-rated-films"')
Expand Down

0 comments on commit ef7aa9e

Please sign in to comment.