@uwdata/mosaic-sql 0.12.2 → 0.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (82) hide show
  1. package/README.md +1 -1
  2. package/dist/types/ast/aggregate.d.ts +5 -4
  3. package/dist/types/ast/case.d.ts +6 -7
  4. package/dist/types/ast/column-param.d.ts +7 -7
  5. package/dist/types/ast/column-ref.d.ts +7 -6
  6. package/dist/types/ast/param.d.ts +5 -4
  7. package/dist/types/ast/query.d.ts +94 -42
  8. package/dist/types/ast/window.d.ts +15 -12
  9. package/dist/types/ast/with.d.ts +11 -1
  10. package/dist/types/functions/aggregate.d.ts +93 -86
  11. package/dist/types/functions/case.d.ts +6 -8
  12. package/dist/types/functions/column.d.ts +5 -3
  13. package/dist/types/functions/cte.d.ts +13 -0
  14. package/dist/types/functions/datetime.d.ts +12 -11
  15. package/dist/types/functions/numeric.d.ts +48 -46
  16. package/dist/types/functions/operators.d.ts +80 -78
  17. package/dist/types/functions/order-by.d.ts +5 -4
  18. package/dist/types/functions/spatial.d.ts +14 -13
  19. package/dist/types/functions/sql-template-tag.d.ts +4 -5
  20. package/dist/types/functions/string.d.ts +22 -20
  21. package/dist/types/functions/util.d.ts +8 -0
  22. package/dist/types/functions/window.d.ts +18 -16
  23. package/dist/types/index.d.ts +5 -1
  24. package/dist/types/transforms/bin-1d.d.ts +3 -2
  25. package/dist/types/transforms/bin-2d.d.ts +6 -5
  26. package/dist/types/transforms/bin-date.d.ts +44 -0
  27. package/dist/types/transforms/bin-histogram.d.ts +51 -0
  28. package/dist/types/transforms/bin-linear-1d.d.ts +6 -4
  29. package/dist/types/transforms/bin-linear-2d.d.ts +6 -5
  30. package/dist/types/transforms/line-density.d.ts +5 -4
  31. package/dist/types/transforms/m4.d.ts +7 -4
  32. package/dist/types/transforms/util/bin-step.d.ts +61 -0
  33. package/dist/types/transforms/util/time-interval.d.ts +13 -0
  34. package/dist/types/types.d.ts +4 -1
  35. package/dist/types/util/ast.d.ts +6 -5
  36. package/dist/types/util/function.d.ts +6 -4
  37. package/dist/types/util/type-check.d.ts +6 -2
  38. package/dist/types/visit/visitors.d.ts +3 -2
  39. package/dist/types/visit/walk.d.ts +7 -4
  40. package/package.json +9 -9
  41. package/src/ast/aggregate.js +5 -2
  42. package/src/ast/case.js +6 -5
  43. package/src/ast/column-param.js +7 -5
  44. package/src/ast/column-ref.js +6 -3
  45. package/src/ast/literal.js +1 -1
  46. package/src/ast/param.js +5 -2
  47. package/src/ast/query.js +120 -47
  48. package/src/ast/window.js +10 -6
  49. package/src/ast/with.js +16 -2
  50. package/src/functions/aggregate.js +63 -51
  51. package/src/functions/case.js +7 -7
  52. package/src/functions/column.js +6 -2
  53. package/src/functions/cte.js +16 -0
  54. package/src/functions/datetime.js +9 -6
  55. package/src/functions/numeric.js +35 -31
  56. package/src/functions/operators.js +53 -50
  57. package/src/functions/order-by.js +5 -2
  58. package/src/functions/spatial.js +10 -7
  59. package/src/functions/sql-template-tag.js +5 -5
  60. package/src/functions/string.js +16 -13
  61. package/src/functions/util.js +14 -0
  62. package/src/functions/window.js +13 -10
  63. package/src/index.js +5 -1
  64. package/src/transforms/bin-1d.js +4 -1
  65. package/src/transforms/bin-2d.js +7 -4
  66. package/src/transforms/bin-date.js +37 -0
  67. package/src/transforms/bin-histogram.js +52 -0
  68. package/src/transforms/bin-linear-1d.js +7 -3
  69. package/src/transforms/bin-linear-2d.js +12 -8
  70. package/src/transforms/line-density.js +7 -3
  71. package/src/transforms/m4.js +19 -6
  72. package/src/transforms/util/bin-step.js +79 -0
  73. package/src/transforms/util/time-interval.js +97 -0
  74. package/src/types.ts +17 -1
  75. package/src/util/ast.js +6 -3
  76. package/src/util/function.js +6 -2
  77. package/src/util/type-check.js +5 -1
  78. package/src/visit/visitors.js +6 -2
  79. package/src/visit/walk.js +8 -3
  80. package/vitest.config.ts +3 -0
  81. package/dist/mosaic-sql.js +0 -2610
  82. package/dist/mosaic-sql.min.js +0 -1
package/README.md CHANGED
@@ -2,6 +2,6 @@
2
2
 
3
3
  [![npm version](https://img.shields.io/npm/v/@uwdata/mosaic-sql.svg)](https://www.npmjs.com/package/@uwdata/mosaic-sql)
4
4
 
5
- An API for convenient construction and analysis of SQL queries. Query objects then coerce to SQL query strings.
5
+ An API for convenient construction and analysis of SQL queries. Constructed `Query` objects coerce to SQL query strings.
6
6
 
7
7
  Many `mosaic-sql` utilities are included as part of the [vgplot](https://github.com/uwdata/mosaic/tree/main/packages/vgplot) API.
@@ -50,16 +50,16 @@ export class AggregateNode extends ExprNode {
50
50
  window(): WindowNode;
51
51
  /**
52
52
  * Return a new window function over this aggregate with the given partitions.
53
- * @param {...import('../types.js').ExprVarArgs} expr The partition by criteria.
53
+ * @param {...ExprVarArgs} expr The partition by criteria.
54
54
  * @returns {WindowNode} A new window node.
55
55
  */
56
- partitionby(...expr: import("../types.js").ExprVarArgs[]): WindowNode;
56
+ partitionby(...expr: ExprVarArgs[]): WindowNode;
57
57
  /**
58
58
  * Return a new window function over this aggregate with the given ordering.
59
- * @param {...import('../types.js').ExprVarArgs} expr The order by criteria.
59
+ * @param {...ExprVarArgs} expr The order by criteria.
60
60
  * @returns {WindowNode} A new window node.
61
61
  */
62
- orderby(...expr: import("../types.js").ExprVarArgs[]): WindowNode;
62
+ orderby(...expr: ExprVarArgs[]): WindowNode;
63
63
  }
64
64
  /**
65
65
  * An array of known aggregate function names.
@@ -68,3 +68,4 @@ export class AggregateNode extends ExprNode {
68
68
  export const aggregateNames: string[];
69
69
  import { ExprNode } from './node.js';
70
70
  import { WindowNode } from './window.js';
71
+ import type { ExprVarArgs } from '../types.js';
@@ -30,19 +30,17 @@ export class CaseNode extends ExprNode {
30
30
  /**
31
31
  * Return a new case node with the given conditional added as
32
32
  * the last WHEN / THEN pair.
33
- * @param {import('../types.js').ExprValue} cond
34
- * The WHEN condition expression.
35
- * @param {import('../types.js').ExprValue} value
36
- * The THEN value expression.
33
+ * @param {ExprValue} cond The WHEN condition expression.
34
+ * @param {ExprValue} value The THEN value expression.
37
35
  * @returns {CaseNode}
38
36
  */
39
- when(cond: import("../types.js").ExprValue, value: import("../types.js").ExprValue): CaseNode;
37
+ when(cond: ExprValue, value: ExprValue): CaseNode;
40
38
  /**
41
39
  * Return a new case node with the given ELSE expression.
42
- * @param {import('../types.js').ExprValue} expr The ELSE expression.
40
+ * @param {ExprValue} expr The ELSE expression.
43
41
  * @returns {CaseNode}
44
42
  */
45
- else(expr: import("../types.js").ExprValue): CaseNode;
43
+ else(expr: ExprValue): CaseNode;
46
44
  }
47
45
  export class WhenNode extends SQLNode {
48
46
  /**
@@ -65,4 +63,5 @@ export class WhenNode extends SQLNode {
65
63
  readonly then: ExprNode;
66
64
  }
67
65
  import { ExprNode } from './node.js';
66
+ import type { ExprValue } from '../types.js';
68
67
  import { SQLNode } from './node.js';
@@ -7,17 +7,17 @@ export function isColumnParam(value: any): value is ColumnParamNode;
7
7
  export class ColumnParamNode extends ColumnRefNode {
8
8
  /**
9
9
  * Instantiate a column param node.
10
- * @param {import('./param.js').ParamNode} param The column name as a
11
- * parameter node.
12
- * @param {import('./table-ref.js').TableRefNode} [table] The table
13
- * reference.
10
+ * @param {ParamNode} param The column name as a parameter node.
11
+ * @param {TableRefNode} [table] The table reference.
14
12
  */
15
- constructor(param: import("./param.js").ParamNode, table?: import("./table-ref.js").TableRefNode);
13
+ constructor(param: ParamNode, table?: TableRefNode);
16
14
  /**
17
15
  * The column name as a parameter node.
18
- * @type {import('./param.js').ParamNode}
16
+ * @type {ParamNode}
19
17
  * @readonly
20
18
  */
21
- readonly param: import("./param.js").ParamNode;
19
+ readonly param: ParamNode;
22
20
  }
23
21
  import { ColumnRefNode } from './column-ref.js';
22
+ import type { ParamNode } from './param.js';
23
+ import type { TableRefNode } from './table-ref.js';
@@ -7,15 +7,15 @@ export function isColumnRef(value: any): value is ColumnRefNode;
7
7
  export class ColumnRefNode extends ExprNode {
8
8
  /**
9
9
  * Instantiate a column reference node.
10
- * @param {import('./table-ref.js').TableRefNode} [table] The table reference.
10
+ * @param {TableRefNode} [table] The table reference.
11
11
  */
12
- constructor(type: any, table?: import("./table-ref.js").TableRefNode);
12
+ constructor(type: any, table?: TableRefNode);
13
13
  /**
14
14
  * The table reference.
15
- * @type {import('./table-ref.js').TableRefNode}
15
+ * @type {TableRefNode}
16
16
  * @readonly
17
17
  */
18
- readonly table: import("./table-ref.js").TableRefNode;
18
+ readonly table: TableRefNode;
19
19
  /**
20
20
  * Returns the column name.
21
21
  * @returns {string}
@@ -26,9 +26,9 @@ export class ColumnNameRefNode extends ColumnRefNode {
26
26
  /**
27
27
  * Instantiate a column reference node.
28
28
  * @param {string} name The column name.
29
- * @param {import('./table-ref.js').TableRefNode} [table] The table reference.
29
+ * @param {TableRefNode} [table] The table reference.
30
30
  */
31
- constructor(name: string, table?: import("./table-ref.js").TableRefNode);
31
+ constructor(name: string, table?: TableRefNode);
32
32
  /**
33
33
  * The column name.
34
34
  * @type {string}
@@ -37,3 +37,4 @@ export class ColumnNameRefNode extends ColumnRefNode {
37
37
  readonly name: string;
38
38
  }
39
39
  import { ExprNode } from './node.js';
40
+ import type { TableRefNode } from './table-ref.js';
@@ -1,15 +1,15 @@
1
1
  export class ParamNode extends ExprNode {
2
2
  /**
3
3
  * Instantiate a param node with a dynamic parameter.
4
- * @param {import('../types.js').ParamLike} param The dynamic parameter.
4
+ * @param {ParamLike} param The dynamic parameter.
5
5
  */
6
- constructor(param: import("../types.js").ParamLike);
6
+ constructor(param: ParamLike);
7
7
  /**
8
8
  * The dynamic parameter.
9
- * @type {import('../types.js').ParamLike}
9
+ * @type {ParamLike}
10
10
  * @readonly
11
11
  */
12
- readonly param: import("../types.js").ParamLike;
12
+ readonly param: ParamLike;
13
13
  /**
14
14
  * Returns the current parameter value.
15
15
  * @returns {*}
@@ -17,3 +17,4 @@ export class ParamNode extends ExprNode {
17
17
  get value(): any;
18
18
  }
19
19
  import { ExprNode } from './node.js';
20
+ import type { ParamLike } from '../types.js';
@@ -18,23 +18,23 @@ export function isSelectQuery(value: any): value is SelectQuery;
18
18
  export function isDescribeQuery(value: any): value is DescribeQuery;
19
19
  export class Query extends ExprNode {
20
20
  /**
21
- * Create a new select query with the given SELECT expressions.
22
- * @param {...import('../types.js').SelectExpr} expr The SELECT expressions.
23
- * @returns {SelectQuery}
21
+ * Create a new WITH clause with the given CTE queries.
22
+ * @param {...WithExpr} expr The WITH CTE queries.
23
+ * @returns {WithClause}
24
24
  */
25
- static select(...expr: import("../types.js").SelectExpr[]): SelectQuery;
25
+ static with(...expr: WithExpr[]): WithClause;
26
26
  /**
27
- * Create a new select query with the given FROM expressions.
28
- * @param {...import('../types.js').FromExpr} expr The FROM expressions.
27
+ * Create a new select query with the given SELECT expressions.
28
+ * @param {...SelectExpr} expr The SELECT expressions.
29
29
  * @returns {SelectQuery}
30
30
  */
31
- static from(...expr: import("../types.js").FromExpr[]): SelectQuery;
31
+ static select(...expr: SelectExpr[]): SelectQuery;
32
32
  /**
33
- * Create a new select query with the given WITH CTE queries.
34
- * @param {...import('../types.js').WithExpr} expr The WITH CTE queries.
33
+ * Create a new select query with the given FROM expressions.
34
+ * @param {...FromExpr} expr The FROM expressions.
35
35
  * @returns {SelectQuery}
36
36
  */
37
- static with(...expr: import("../types.js").WithExpr[]): SelectQuery;
37
+ static from(...expr: FromExpr[]): SelectQuery;
38
38
  /**
39
39
  * Create a new UNION set operation over the given queries.
40
40
  * @param {...Query} queries The queries.
@@ -69,6 +69,8 @@ export class Query extends ExprNode {
69
69
  * Instantiate a new query.
70
70
  */
71
71
  constructor(type: any);
72
+ /** @type {WithClauseNode[]} */
73
+ _with: WithClauseNode[];
72
74
  /** @type {ExprNode[]} */
73
75
  _orderby: ExprNode[];
74
76
  /** @type {number} */
@@ -87,12 +89,18 @@ export class Query extends ExprNode {
87
89
  * @returns {Query}
88
90
  */
89
91
  clone(): Query;
92
+ /**
93
+ * Add WITH common table expressions (CTEs).
94
+ * @param {...WithExpr} expr Expressions to add.
95
+ * @returns {this}
96
+ */
97
+ with(...expr: WithExpr[]): this;
90
98
  /**
91
99
  * Add ORDER BY expressions.
92
- * @param {...import('../types.js').OrderByExpr} expr Expressions to add.
100
+ * @param {...OrderByExpr} expr Expressions to add.
93
101
  * @returns
94
102
  */
95
- orderby(...expr: import("../types.js").OrderByExpr[]): this;
103
+ orderby(...expr: OrderByExpr[]): this;
96
104
  /**
97
105
  * Set the query result LIMIT.
98
106
  * @param {number} value The limit value.
@@ -111,8 +119,6 @@ export class SelectQuery extends Query {
111
119
  * Instantiate a new select query.
112
120
  */
113
121
  constructor();
114
- /** @type {WithClauseNode[]} */
115
- _with: WithClauseNode[];
116
122
  /** @type {SelectClauseNode[]} */
117
123
  _select: SelectClauseNode[];
118
124
  /** @type {FromClauseNode[]} */
@@ -134,24 +140,18 @@ export class SelectQuery extends Query {
134
140
  * @returns {SelectQuery}
135
141
  */
136
142
  clone(): SelectQuery;
137
- /**
138
- * Add WITH common table expressions (CTEs).
139
- * @param {...import('../types.js').WithExpr} expr Expressions to add.
140
- * @returns {this}
141
- */
142
- with(...expr: import("../types.js").WithExpr[]): this;
143
143
  /**
144
144
  * Add SELECT expressions.
145
- * @param {...import('../types.js').SelectExpr} expr Expressions to add.
145
+ * @param {...SelectExpr} expr Expressions to add.
146
146
  * @returns {this}
147
147
  */
148
- select(...expr: import("../types.js").SelectExpr[]): this;
148
+ select(...expr: SelectExpr[]): this;
149
149
  /**
150
150
  * Set SELECT expressions, replacing any prior expressions.
151
- * @param {...import('../types.js').SelectExpr} expr Expressions to add.
151
+ * @param {...SelectExpr} expr Expressions to add.
152
152
  * @returns {this}
153
153
  */
154
- setSelect(...expr: import("../types.js").SelectExpr[]): this;
154
+ setSelect(...expr: SelectExpr[]): this;
155
155
  /**
156
156
  * Indicate if this query should retrieve distinct values only.
157
157
  * @param {boolean} value The distinct flag
@@ -161,56 +161,56 @@ export class SelectQuery extends Query {
161
161
  _distinct: boolean;
162
162
  /**
163
163
  * Add table FROM expressions.
164
- * @param {...import('../types.js').FromExpr} expr Expressions to add.
164
+ * @param {...FromExpr} expr Expressions to add.
165
165
  * @returns {this}
166
166
  */
167
- from(...expr: import("../types.js").FromExpr[]): this;
167
+ from(...expr: FromExpr[]): this;
168
168
  /**
169
169
  * Set FROM expressions, replacing any prior expressions.
170
- * @param {...import('../types.js').FromExpr} expr Expressions to add.
170
+ * @param {...FromExpr} expr Expressions to add.
171
171
  * @returns {this}
172
172
  */
173
- setFrom(...expr: import("../types.js").FromExpr[]): this;
173
+ setFrom(...expr: FromExpr[]): this;
174
174
  /**
175
175
  * Set SAMPLE settings.
176
176
  * @param {number | SampleClauseNode} value Either a sample clause node
177
177
  * or the sample size as either a row count or percentage.
178
- * @param {import('./sample.js').SampleMethod} [method] The sampling method
178
+ * @param {SampleMethod} [method] The sampling method
179
179
  * to use.
180
180
  * @param {number} [seed] The random seed.
181
181
  * @returns {this}
182
182
  */
183
- sample(value: number | SampleClauseNode, method?: import("./sample.js").SampleMethod, seed?: number): this;
183
+ sample(value: number | SampleClauseNode, method?: SampleMethod, seed?: number): this;
184
184
  /**
185
185
  * Add WHERE expressions.
186
- * @param {...import('../types.js').FilterExpr} expr Expressions to add.
186
+ * @param {...FilterExpr} expr Expressions to add.
187
187
  * @returns {this}
188
188
  */
189
- where(...expr: import("../types.js").FilterExpr[]): this;
189
+ where(...expr: FilterExpr[]): this;
190
190
  /**
191
191
  * Set WHERE expressions, replacing any prior expressions.
192
- * @param {...import('../types.js').FilterExpr} expr Expressions to add.
192
+ * @param {...FilterExpr} expr Expressions to add.
193
193
  * @returns {this}
194
194
  */
195
- setWhere(...expr: import("../types.js").FilterExpr[]): this;
195
+ setWhere(...expr: FilterExpr[]): this;
196
196
  /**
197
197
  * Add GROUP BY expressions.
198
- * @param {...import('../types.js').GroupByExpr} expr Expressions to add.
198
+ * @param {...GroupByExpr} expr Expressions to add.
199
199
  * @returns {this}
200
200
  */
201
- groupby(...expr: import("../types.js").GroupByExpr[]): this;
201
+ groupby(...expr: GroupByExpr[]): this;
202
202
  /**
203
203
  * Set GROUP BY expressions, replacing any prior expressions.
204
- * @param {...import('../types.js').GroupByExpr} expr Expressions to add.
204
+ * @param {...GroupByExpr} expr Expressions to add.
205
205
  * @returns {this}
206
206
  */
207
- setGroupby(...expr: import("../types.js").GroupByExpr[]): this;
207
+ setGroupby(...expr: GroupByExpr[]): this;
208
208
  /**
209
209
  * Add HAVING expressions.
210
- * @param {...import('../types.js').FilterExpr} expr Expressions to add.
210
+ * @param {...FilterExpr} expr Expressions to add.
211
211
  * @returns {this}
212
212
  */
213
- having(...expr: import("../types.js").FilterExpr[]): this;
213
+ having(...expr: FilterExpr[]): this;
214
214
  /**
215
215
  * Add WINDOW definitions.
216
216
  * @param {...any} expr Expressions to add.
@@ -219,10 +219,10 @@ export class SelectQuery extends Query {
219
219
  window(...expr: any[]): this;
220
220
  /**
221
221
  * Add QUALIFY expressions.
222
- * @param {...import('../types.js').FilterExpr} expr Expressions to add.
222
+ * @param {...FilterExpr} expr Expressions to add.
223
223
  * @returns {this}
224
224
  */
225
- qualify(...expr: import("../types.js").FilterExpr[]): this;
225
+ qualify(...expr: FilterExpr[]): this;
226
226
  }
227
227
  export class DescribeQuery extends SQLNode {
228
228
  /**
@@ -261,8 +261,60 @@ export class SetOperation extends Query {
261
261
  }
262
262
  import { ExprNode } from './node.js';
263
263
  import { WithClauseNode } from './with.js';
264
+ import type { WithExpr } from '../types.js';
265
+ import type { OrderByExpr } from '../types.js';
266
+ declare class WithClause {
267
+ /**
268
+ * Instantiate a new WITH clause instance.
269
+ * @param {...WithExpr} expr The WITH CTE queries.
270
+ */
271
+ constructor(...expr: WithExpr[]);
272
+ _with: WithExpr[];
273
+ /**
274
+ * Create a new select query with the given SELECT expressions.
275
+ * @param {...SelectExpr} expr The SELECT expressions.
276
+ * @returns {SelectQuery}
277
+ */
278
+ select(...expr: SelectExpr[]): SelectQuery;
279
+ /**
280
+ * Create a new select query with the given FROM expressions.
281
+ * @param {...FromExpr} expr The FROM expressions.
282
+ * @returns {SelectQuery}
283
+ */
284
+ from(...expr: FromExpr[]): SelectQuery;
285
+ /**
286
+ * Create a new UNION set operation over the given queries.
287
+ * @param {...Query} queries The queries.
288
+ * @returns {SetOperation}
289
+ */
290
+ union(...queries: Query[]): SetOperation;
291
+ /**
292
+ * Create a new UNION ALL set operation over the given queries.
293
+ * @param {...Query} queries The queries.
294
+ * @returns {SetOperation}
295
+ */
296
+ unionAll(...queries: Query[]): SetOperation;
297
+ /**
298
+ * Create a new INTERSECT set operation over the given queries.
299
+ * @param {...Query} queries The queries.
300
+ * @returns {SetOperation}
301
+ */
302
+ intersect(...queries: Query[]): SetOperation;
303
+ /**
304
+ * Create a new EXCEPT set operation over the given queries.
305
+ * @param {...Query} queries The queries.
306
+ * @returns {SetOperation}
307
+ */
308
+ except(...queries: Query[]): SetOperation;
309
+ }
310
+ import type { SelectExpr } from '../types.js';
311
+ import type { FromExpr } from '../types.js';
264
312
  import { SelectClauseNode } from './select.js';
265
313
  import { FromClauseNode } from './from.js';
266
314
  import { SampleClauseNode } from './sample.js';
267
315
  import { WindowClauseNode } from './window.js';
316
+ import type { SampleMethod } from './sample.js';
317
+ import type { FilterExpr } from '../types.js';
318
+ import type { GroupByExpr } from '../types.js';
268
319
  import { SQLNode } from './node.js';
320
+ export {};
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @typedef {[any, any] | import('../types.js').ParamLike} FrameExtent
2
+ * @typedef {[any, any] | ParamLike} FrameExtent
3
3
  */
4
4
  export class WindowClauseNode extends SQLNode {
5
5
  /**
@@ -46,16 +46,16 @@ export class WindowNode extends ExprNode {
46
46
  over(name: string): WindowNode;
47
47
  /**
48
48
  * Return an updated window with the given partitions.
49
- * @param {...import('../types.js').ExprVarArgs} expr The partition by criteria.
49
+ * @param {...ExprVarArgs} expr The partition by criteria.
50
50
  * @returns {WindowNode} A new window node.
51
51
  */
52
- partitionby(...expr: import("../types.js").ExprVarArgs[]): WindowNode;
52
+ partitionby(...expr: ExprVarArgs[]): WindowNode;
53
53
  /**
54
54
  * Return an updated window with the given ordering.
55
- * @param {...import('../types.js').ExprVarArgs} expr The order by criteria.
55
+ * @param {...ExprVarArgs} expr The order by criteria.
56
56
  * @returns {WindowNode} A new window node.
57
57
  */
58
- orderby(...expr: import("../types.js").ExprVarArgs[]): WindowNode;
58
+ orderby(...expr: ExprVarArgs[]): WindowNode;
59
59
  /**
60
60
  * Return an updated window with the given rows frame.
61
61
  * @param {FrameExtent} extent The row-based window frame extent.
@@ -72,10 +72,10 @@ export class WindowNode extends ExprNode {
72
72
  export class WindowFunctionNode extends FunctionNode {
73
73
  /**
74
74
  * Instantiate a window function call node.
75
- * @param {import('../types.js').WindowFunctionName} name The function name.
75
+ * @param {WindowFunctionName} name The function name.
76
76
  * @param {ExprNode[]} [args=[]] The function arguments.
77
77
  */
78
- constructor(name: import("../types.js").WindowFunctionName, args?: ExprNode[]);
78
+ constructor(name: WindowFunctionName, args?: ExprNode[]);
79
79
  }
80
80
  export class WindowDefNode extends SQLNode {
81
81
  /**
@@ -118,16 +118,16 @@ export class WindowDefNode extends SQLNode {
118
118
  over(name: string): WindowDefNode;
119
119
  /**
120
120
  * Return an updated window definition with the given partitions.
121
- * @param {...import('../types.js').ExprVarArgs} expr The partition by criteria.
121
+ * @param {...ExprVarArgs} expr The partition by criteria.
122
122
  * @returns {WindowDefNode} A new window definition node.
123
123
  */
124
- partitionby(...expr: import("../types.js").ExprVarArgs[]): WindowDefNode;
124
+ partitionby(...expr: ExprVarArgs[]): WindowDefNode;
125
125
  /**
126
126
  * Return an updated window definition with the given ordering.
127
- * @param {...import('../types.js').ExprVarArgs} expr The order by criteria.
127
+ * @param {...ExprVarArgs} expr The order by criteria.
128
128
  * @returns {WindowDefNode} A new window definition node.
129
129
  */
130
- orderby(...expr: import("../types.js").ExprVarArgs[]): WindowDefNode;
130
+ orderby(...expr: ExprVarArgs[]): WindowDefNode;
131
131
  /**
132
132
  * Return an updated window definition with the given rows frame.
133
133
  * @param {FrameExtent} extent The row-based window frame extent.
@@ -169,9 +169,12 @@ export class WindowFrameNode extends SQLNode {
169
169
  */
170
170
  readonly exclude: ExprNode;
171
171
  }
172
- export type FrameExtent = [any, any] | import("../types.js").ParamLike;
172
+ export type FrameExtent = [any, any] | ParamLike;
173
173
  import { SQLNode } from './node.js';
174
174
  import { ExprNode } from './node.js';
175
175
  import { AggregateNode } from './aggregate.js';
176
+ import type { ExprVarArgs } from '../types.js';
176
177
  import { FunctionNode } from './function.js';
178
+ import type { WindowFunctionName } from '../types.js';
177
179
  import { ParamNode } from './param.js';
180
+ import type { ParamLike } from '../types.js';
@@ -3,8 +3,12 @@ export class WithClauseNode extends SQLNode {
3
3
  * Instantiate a with clause node for a common table expression (CTE).
4
4
  * @param {string} name The common table expression (CTE) name.
5
5
  * @param {Query} query The common table expression (CTE) query.
6
+ * @param {boolean | null} [materialized] The common table expression (CTE)
7
+ * materialization flag. If `true`, forces materialization of the CTE.
8
+ * If `false`, materialization is not performed. Otherwise (for example, if
9
+ * `undefined` or `null`), materialization is decided by the database.
6
10
  */
7
- constructor(name: string, query: Query);
11
+ constructor(name: string, query: Query, materialized?: boolean | null);
8
12
  /**
9
13
  * The common table expression (CTE) name.
10
14
  * @type {string}
@@ -17,6 +21,12 @@ export class WithClauseNode extends SQLNode {
17
21
  * @readonly
18
22
  */
19
23
  readonly query: Query;
24
+ /**
25
+ * The common table expression (CTE) materialization flag.
26
+ * @type {boolean | null}
27
+ * @readonly
28
+ */
29
+ readonly materialized: boolean | null;
20
30
  }
21
31
  import { SQLNode } from './node.js';
22
32
  import { Query } from './query.js';