Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@synatic/noql",
"version": "4.1.13",
"version": "4.1.14",
"description": "Convert SQL statements to mongo queries or aggregates",
"main": "index.js",
"files": [
Expand Down Expand Up @@ -71,7 +71,7 @@
"dayjs": "^1.11.13",
"deepmerge": "^4.3.1",
"lodash": "^4.17.21",
"node-sql-parser": "^5.2.0"
"node-sql-parser": "^5.3.3"
},
"devDependencies": {
"@synatic/eslint-config-synatic-node": "^2.0.0",
Expand Down
12 changes: 12 additions & 0 deletions test/intersect-except/intersect-except.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,18 @@
"year": 1994
}
]
},
"case2": {
"expectedResults": [
{
"name": "12 Angry Men",
"year": 1957
},
{
"name": "The Shawshank Redemption",
"year": 1994
}
]
}
}
}
16 changes: 16 additions & 0 deletions test/intersect-except/intersect-except.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,5 +129,21 @@ describe('intersect & except', function () {
schemas: await getAllSchemas(database),
});
});
it('should allow you to get the EXCEPT of two queries from different tables for a * with string and number values and order by without a where clause', async () => {
const queryString = `
SELECT *,unset(_id)
FROM "top-rated-films"
EXCEPT
SELECT *,unset(_id)
FROM "most-popular-films"
ORDER BY name
`;
await queryResultTester({
queryString: queryString,
casePath: 'except.case2',
mode,
schemas: await getAllSchemas(database),
});
});
});
});
Loading