Skip to content

Commit 1e3435f

Browse files
committed
fix: stringify having.
1 parent ff9b7ce commit 1e3435f

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "js-sql-parser",
3-
"version": "1.1.0",
3+
"version": "1.1.1",
44
"description": "",
55
"main": "./dist/parser/sqlParser.js",
66
"scripts": {

src/stringify.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ Sql.prototype.travelSelect = function(ast) {
107107
this.travel(ast.groupBy);
108108
}
109109
if (ast.having) {
110+
this.appendKeyword('having');
110111
this.travel(ast.having);
111112
}
112113
if (ast.orderBy) {

test/main.test.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -377,5 +377,9 @@ describe('select grammar support', function () {
377377
testParser('select a from dual order by a desc limit 1, 1 union distinct select a from foo order by a limit 1');
378378
});
379379

380+
it ('fix having', function () {
381+
testParser('select a, count(*) cnt from b group by a having count(*) > 1;');
382+
});
383+
380384
});
381385

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy