File tree 3 files changed +24
-1
lines changed
3 files changed +24
-1
lines changed Original file line number Diff line number Diff line change 36
36
],
37
37
"dependencies" : {
38
38
"prettier" : " ^3.0.3" ,
39
- "sql-parser-cst" : " ^0.31.1 "
39
+ "sql-parser-cst" : " ^0.32.0 "
40
40
},
41
41
"devDependencies" : {
42
42
"@types/jest" : " ^29.2.5" ,
Original file line number Diff line number Diff line change @@ -180,6 +180,7 @@ export const selectMap: CstToDocMap<AllSelectNodes> = {
180
180
group_by_cube : ( print ) => print ( [ "cubeKw" , "columns" ] ) ,
181
181
group_by_grouping_sets : ( print ) =>
182
182
print . spaced ( [ "groupingSetsKw" , "columns" ] ) ,
183
+ group_by_all : ( print ) => print ( [ "allKw" ] ) ,
183
184
184
185
// PARTITION BY clause
185
186
partition_by_clause : ( print ) =>
Original file line number Diff line number Diff line change @@ -185,6 +185,28 @@ describe("select", () => {
185
185
` ) ;
186
186
} ) ;
187
187
188
+ it ( `formats short query with GROUP BY ALL` , async ( ) => {
189
+ await testBigquery ( dedent `
190
+ SELECT * FROM tbl GROUP BY ALL
191
+ ` ) ;
192
+ } ) ;
193
+
194
+ it ( `formats long query with GROUP BY ALL` , async ( ) => {
195
+ await testBigquery ( dedent `
196
+ SELECT *
197
+ FROM my_table_name
198
+ GROUP BY ALL
199
+ HAVING my_table_name.col1 > 1
200
+ LIMIT 5
201
+ ` ) ;
202
+ } ) ;
203
+
204
+ it ( `capitalizes GROUP BY all` , async ( ) => {
205
+ expect (
206
+ await pretty ( `SELECT * FROM tbl GROUP BY all` , { dialect : "bigquery" } ) ,
207
+ ) . toBe ( `SELECT * FROM tbl GROUP BY ALL` ) ;
208
+ } ) ;
209
+
188
210
it ( `formats QUALIFY clause` , async ( ) => {
189
211
await testBigquery ( `SELECT * FROM tbl QUALIFY x > 10` ) ;
190
212
} ) ;
You can’t perform that action at this time.
0 commit comments