Skip to content

Commit 37681d7

Browse files
committed
Merge #41: Format GROUP BY ALL for BigQuery
2 parents ed4176f + fe29ccd commit 37681d7

File tree

4 files changed

+13
-5
lines changed

4 files changed

+13
-5
lines changed

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"version": "0.12.1",
44
"description": "Prettier plugin for SQL",
55
"contributors": [
6+
"Barna Magyarkuti <[email protected]>",
67
"Bowen Parnell <[email protected]>",
78
"Rene Saarsoo <[email protected]>"
89
],
@@ -36,7 +37,7 @@
3637
],
3738
"dependencies": {
3839
"prettier": "^3.0.3",
39-
"sql-parser-cst": "^0.31.1"
40+
"sql-parser-cst": "^0.32.0"
4041
},
4142
"devDependencies": {
4243
"@types/jest": "^29.2.5",

src/syntax/select.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,7 @@ export const selectMap: CstToDocMap<AllSelectNodes> = {
180180
group_by_cube: (print) => print(["cubeKw", "columns"]),
181181
group_by_grouping_sets: (print) =>
182182
print.spaced(["groupingSetsKw", "columns"]),
183+
group_by_all: (print) => print(["allKw"]),
183184

184185
// PARTITION BY clause
185186
partition_by_clause: (print) =>

test/select/select.test.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,12 @@ describe("select", () => {
185185
`);
186186
});
187187

188+
it(`formats GROUP BY ALL`, async () => {
189+
await testBigquery(dedent`
190+
SELECT * FROM tbl GROUP BY ALL
191+
`);
192+
});
193+
188194
it(`formats QUALIFY clause`, async () => {
189195
await testBigquery(`SELECT * FROM tbl QUALIFY x > 10`);
190196
});

yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2181,10 +2181,10 @@ sprintf-js@~1.0.2:
21812181
resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c"
21822182
integrity sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==
21832183

2184-
sql-parser-cst@^0.31.1:
2185-
version "0.31.1"
2186-
resolved "https://registry.yarnpkg.com/sql-parser-cst/-/sql-parser-cst-0.31.1.tgz#c7d4e1b3f355e7f687aec2682f69f0593c2f1892"
2187-
integrity sha512-Af1QRnlMwDPQHFXrnt4lSYXxxEHvB/UvYroOe3oHFvfxZhGZ4uKlFSCCPoIhN3lReBQJIoXFwkNCTsS7rYUX7Q==
2184+
sql-parser-cst@^0.32.0:
2185+
version "0.32.0"
2186+
resolved "https://registry.yarnpkg.com/sql-parser-cst/-/sql-parser-cst-0.32.0.tgz#26bedbd8309801f1218a683a67b3c6af136816e9"
2187+
integrity sha512-J/8IeKGBGftFbssmWlE7NnIOnkH0EW8FwJoctcgZB9cY0aeCb1QFp/rl9uYPX87SY38PwCKiPUJO8+fssqg5vQ==
21882188

21892189
stack-utils@^2.0.3:
21902190
version "2.0.6"

0 commit comments

Comments
 (0)