@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
@@ -1,229 +1,236 @@
1
1
  /**
2
2
  * Compute an arg_max aggregate.
3
- * @param {import('../types.js').ExprValue} y The argument to return.
4
- * @param {import('../types.js').ExprValue} x The expression to maximize.
3
+ * @param {ExprValue} y The argument to return.
4
+ * @param {ExprValue} x The expression to maximize.
5
5
  * @returns {AggregateNode} A SQL aggregate function call.
6
6
  */
7
- export function argmax(y: import("../types.js").ExprValue, x: import("../types.js").ExprValue): AggregateNode;
7
+ export function argmax(y: ExprValue, x: ExprValue): AggregateNode;
8
8
  /**
9
9
  * Compute an arg_min aggregate.
10
- * @param {import('../types.js').ExprValue} y The argument to return.
11
- * @param {import('../types.js').ExprValue} x The expression to minimize.
10
+ * @param {ExprValue} y The argument to return.
11
+ * @param {ExprValue} x The expression to minimize.
12
12
  * @returns {AggregateNode} A SQL aggregate function call.
13
13
  */
14
- export function argmin(y: import("../types.js").ExprValue, x: import("../types.js").ExprValue): AggregateNode;
14
+ export function argmin(y: ExprValue, x: ExprValue): AggregateNode;
15
15
  /**
16
16
  * Compute an array aggregation.
17
- * @param {import('../types.js').ExprValue} expr The expression to aggregate.
17
+ * @param {ExprValue} expr The expression to aggregate.
18
18
  * @returns {AggregateNode} A SQL aggregate function call.
19
19
  */
20
- export function arrayAgg(expr: import("../types.js").ExprValue): AggregateNode;
20
+ export function arrayAgg(expr: ExprValue): AggregateNode;
21
21
  /**
22
22
  * Compute an average aggregate.
23
- * @param {import('../types.js').ExprValue} expr The expression to aggregate.
23
+ * @param {ExprValue} expr The expression to aggregate.
24
24
  * @returns {AggregateNode} A SQL aggregate function call.
25
25
  */
26
- export function avg(expr: import("../types.js").ExprValue): AggregateNode;
26
+ export function avg(expr: ExprValue): AggregateNode;
27
27
  /**
28
28
  * Compute a correlation aggregate.
29
- * @param {import('../types.js').ExprValue} x The x expression to aggregate.
30
- * @param {import('../types.js').ExprValue} y The y expression to aggregate.
29
+ * @param {ExprValue} x The x expression to aggregate.
30
+ * @param {ExprValue} y The y expression to aggregate.
31
31
  * @returns {AggregateNode} A SQL aggregate function call.
32
32
  */
33
- export function corr(x: import("../types.js").ExprValue, y: import("../types.js").ExprValue): AggregateNode;
33
+ export function corr(x: ExprValue, y: ExprValue): AggregateNode;
34
34
  /**
35
35
  * Compute a count aggregate.
36
- * @param {import('../types.js').ExprValue} [expr] An optional expression
36
+ * @param {ExprValue} [expr] An optional expression
37
37
  * to count. If specified, only non-null expression values are counted.
38
38
  * If omitted, all rows within a group are counted.
39
39
  * @returns {AggregateNode} A SQL aggregate function call.
40
40
  */
41
- export function count(expr?: import("../types.js").ExprValue): AggregateNode;
41
+ export function count(expr?: ExprValue): AggregateNode;
42
42
  /**
43
43
  * Compute a sample covariance aggregate.
44
- * @param {import('../types.js').ExprValue} x The x expression to aggregate.
45
- * @param {import('../types.js').ExprValue} y The y expression to aggregate.
44
+ * @param {ExprValue} x The x expression to aggregate.
45
+ * @param {ExprValue} y The y expression to aggregate.
46
46
  * @returns {AggregateNode} A SQL aggregate function call.
47
47
  */
48
- export function covariance(x: import("../types.js").ExprValue, y: import("../types.js").ExprValue): AggregateNode;
48
+ export function covariance(x: ExprValue, y: ExprValue): AggregateNode;
49
49
  /**
50
50
  * Compute a population covariance aggregate.
51
- * @param {import('../types.js').ExprValue} x The x expression to aggregate.
52
- * @param {import('../types.js').ExprValue} y The y expression to aggregate.
51
+ * @param {ExprValue} x The x expression to aggregate.
52
+ * @param {ExprValue} y The y expression to aggregate.
53
53
  * @returns {AggregateNode} A SQL aggregate function call.
54
54
  */
55
- export function covarPop(x: import("../types.js").ExprValue, y: import("../types.js").ExprValue): AggregateNode;
55
+ export function covarPop(x: ExprValue, y: ExprValue): AggregateNode;
56
56
  /**
57
57
  * Compute an entropy aggregate.
58
- * @param {import('../types.js').ExprValue} expr The expression to aggregate.
58
+ * @param {ExprValue} expr The expression to aggregate.
59
59
  * @returns {AggregateNode} A SQL aggregate function call.
60
60
  */
61
- export function entropy(expr: import("../types.js").ExprValue): AggregateNode;
61
+ export function entropy(expr: ExprValue): AggregateNode;
62
62
  /**
63
63
  * Compute a first aggregate.
64
- * @param {import('../types.js').ExprValue} expr The expression to aggregate.
64
+ * @param {ExprValue} expr The expression to aggregate.
65
65
  * @returns {AggregateNode} A SQL aggregate function call.
66
66
  */
67
- export function first(expr: import("../types.js").ExprValue): AggregateNode;
67
+ export function first(expr: ExprValue): AggregateNode;
68
+ /**
69
+ * Compute a geomean aggregate.
70
+ * @param {ExprValue} expr The expression to aggregate.
71
+ * @returns {AggregateNode} A SQL aggregate function call.
72
+ */
73
+ export function geomean(expr: ExprValue): AggregateNode;
68
74
  /**
69
75
  * Compute a sample kurtosis aggregate.
70
- * @param {import('../types.js').ExprValue} expr The expression to aggregate.
76
+ * @param {ExprValue} expr The expression to aggregate.
71
77
  * @returns {AggregateNode} A SQL aggregate function call.
72
78
  */
73
- export function kurtosis(expr: import("../types.js").ExprValue): AggregateNode;
79
+ export function kurtosis(expr: ExprValue): AggregateNode;
74
80
  /**
75
81
  * Compute a median absolute deviation (MAD) aggregate.
76
- * @param {import('../types.js').ExprValue} expr The expression to aggregate.
82
+ * @param {ExprValue} expr The expression to aggregate.
77
83
  * @returns {AggregateNode} A SQL aggregate function call.
78
84
  */
79
- export function mad(expr: import("../types.js").ExprValue): AggregateNode;
85
+ export function mad(expr: ExprValue): AggregateNode;
80
86
  /**
81
87
  * Compute a maximum aggregate.
82
- * @param {import('../types.js').ExprValue} expr The expression to aggregate.
88
+ * @param {ExprValue} expr The expression to aggregate.
83
89
  * @returns {AggregateNode} A SQL aggregate function call.
84
90
  */
85
- export function max(expr: import("../types.js").ExprValue): AggregateNode;
91
+ export function max(expr: ExprValue): AggregateNode;
86
92
  /**
87
93
  * Compute a median aggregate.
88
- * @param {import('../types.js').ExprValue} expr The expression to aggregate.
94
+ * @param {ExprValue} expr The expression to aggregate.
89
95
  * @returns {AggregateNode} A SQL aggregate function call.
90
96
  */
91
- export function median(expr: import("../types.js").ExprValue): AggregateNode;
97
+ export function median(expr: ExprValue): AggregateNode;
92
98
  /**
93
99
  * Compute a minimum aggregate.
94
- * @param {import('../types.js').ExprValue} expr The expression to aggregate.
100
+ * @param {ExprValue} expr The expression to aggregate.
95
101
  * @returns {AggregateNode} A SQL aggregate function call.
96
102
  */
97
- export function min(expr: import("../types.js").ExprValue): AggregateNode;
103
+ export function min(expr: ExprValue): AggregateNode;
98
104
  /**
99
105
  * Compute a mode aggregate.
100
- * @param {import('../types.js').ExprValue} expr The expression to aggregate.
106
+ * @param {ExprValue} expr The expression to aggregate.
101
107
  * @returns {AggregateNode} A SQL aggregate function call.
102
108
  */
103
- export function mode(expr: import("../types.js").ExprValue): AggregateNode;
109
+ export function mode(expr: ExprValue): AggregateNode;
104
110
  /**
105
111
  * Compute a last aggregate.
106
- * @param {import('../types.js').ExprValue} expr The expression to aggregate.
112
+ * @param {ExprValue} expr The expression to aggregate.
107
113
  * @returns {AggregateNode} A SQL aggregate function call.
108
114
  */
109
- export function last(expr: import("../types.js").ExprValue): AggregateNode;
115
+ export function last(expr: ExprValue): AggregateNode;
110
116
  /**
111
117
  * Compute a product aggregate.
112
- * @param {import('../types.js').ExprValue} expr The expression to aggregate.
118
+ * @param {ExprValue} expr The expression to aggregate.
113
119
  * @returns {AggregateNode} A SQL aggregate function call.
114
120
  */
115
- export function product(expr: import("../types.js").ExprValue): AggregateNode;
121
+ export function product(expr: ExprValue): AggregateNode;
116
122
  /**
117
123
  * Compute a quantile aggregate.
118
- * @param {import('../types.js').ExprValue} expr The expression to aggregate.
119
- * @param {import('../types.js').ExprValue} p The quantile value.
124
+ * @param {ExprValue} expr The expression to aggregate.
125
+ * @param {ExprValue} p The quantile value.
120
126
  * @returns {AggregateNode} A SQL aggregate function call.
121
127
  */
122
- export function quantile(expr: import("../types.js").ExprValue, p: import("../types.js").ExprValue): AggregateNode;
128
+ export function quantile(expr: ExprValue, p: ExprValue): AggregateNode;
123
129
  /**
124
130
  * Compute a linear regression reg_avgX aggregate.
125
- * @param {import('../types.js').ExprValue} x The x expression to aggregate.
126
- * @param {import('../types.js').ExprValue} y The y expression to aggregate.
131
+ * @param {ExprValue} x The x expression to aggregate.
132
+ * @param {ExprValue} y The y expression to aggregate.
127
133
  * @returns {AggregateNode} A SQL aggregate function call.
128
134
  */
129
- export function regrAvgX(x: import("../types.js").ExprValue, y: import("../types.js").ExprValue): AggregateNode;
135
+ export function regrAvgX(x: ExprValue, y: ExprValue): AggregateNode;
130
136
  /**
131
137
  * Compute a linear regression reg_avgY aggregate.
132
- * @param {import('../types.js').ExprValue} x The x expression to aggregate.
133
- * @param {import('../types.js').ExprValue} y The y expression to aggregate.
138
+ * @param {ExprValue} x The x expression to aggregate.
139
+ * @param {ExprValue} y The y expression to aggregate.
134
140
  * @returns {AggregateNode} A SQL aggregate function call.
135
141
  */
136
- export function regrAvgY(x: import("../types.js").ExprValue, y: import("../types.js").ExprValue): AggregateNode;
142
+ export function regrAvgY(x: ExprValue, y: ExprValue): AggregateNode;
137
143
  /**
138
144
  * Compute a linear regression count aggregate.
139
145
  * This returns the count of rows where both x and y are non-null.
140
- * @param {import('../types.js').ExprValue} x The x expression to aggregate.
141
- * @param {import('../types.js').ExprValue} y The y expression to aggregate.
146
+ * @param {ExprValue} x The x expression to aggregate.
147
+ * @param {ExprValue} y The y expression to aggregate.
142
148
  * @returns {AggregateNode} A SQL aggregate function call.
143
149
  */
144
- export function regrCount(x: import("../types.js").ExprValue, y: import("../types.js").ExprValue): AggregateNode;
150
+ export function regrCount(x: ExprValue, y: ExprValue): AggregateNode;
145
151
  /**
146
152
  * Compute a linear regression intercept aggregate.
147
- * @param {import('../types.js').ExprValue} x The x expression to aggregate.
148
- * @param {import('../types.js').ExprValue} y The y expression to aggregate.
153
+ * @param {ExprValue} x The x expression to aggregate.
154
+ * @param {ExprValue} y The y expression to aggregate.
149
155
  * @returns {AggregateNode} A SQL aggregate function call.
150
156
  */
151
- export function regrIntercept(x: import("../types.js").ExprValue, y: import("../types.js").ExprValue): AggregateNode;
157
+ export function regrIntercept(x: ExprValue, y: ExprValue): AggregateNode;
152
158
  /**
153
159
  * Compute a linear regression R^2 aggregate.
154
- * @param {import('../types.js').ExprValue} x The x expression to aggregate.
155
- * @param {import('../types.js').ExprValue} y The y expression to aggregate.
160
+ * @param {ExprValue} x The x expression to aggregate.
161
+ * @param {ExprValue} y The y expression to aggregate.
156
162
  * @returns {AggregateNode} A SQL aggregate function call.
157
163
  */
158
- export function regrR2(x: import("../types.js").ExprValue, y: import("../types.js").ExprValue): AggregateNode;
164
+ export function regrR2(x: ExprValue, y: ExprValue): AggregateNode;
159
165
  /**
160
166
  * Compute a linear regression regr_sxx aggregate.
161
- * @param {import('../types.js').ExprValue} x The x expression to aggregate.
162
- * @param {import('../types.js').ExprValue} y The y expression to aggregate.
167
+ * @param {ExprValue} x The x expression to aggregate.
168
+ * @param {ExprValue} y The y expression to aggregate.
163
169
  * @returns {AggregateNode} A SQL aggregate function call.
164
170
  */
165
- export function regrSXX(x: import("../types.js").ExprValue, y: import("../types.js").ExprValue): AggregateNode;
171
+ export function regrSXX(x: ExprValue, y: ExprValue): AggregateNode;
166
172
  /**
167
173
  * Compute a linear regression regr_sxy aggregate.
168
- * @param {import('../types.js').ExprValue} x The x expression to aggregate.
169
- * @param {import('../types.js').ExprValue} y The y expression to aggregate.
174
+ * @param {ExprValue} x The x expression to aggregate.
175
+ * @param {ExprValue} y The y expression to aggregate.
170
176
  * @returns {AggregateNode} A SQL aggregate function call.
171
177
  */
172
- export function regrSXY(x: import("../types.js").ExprValue, y: import("../types.js").ExprValue): AggregateNode;
178
+ export function regrSXY(x: ExprValue, y: ExprValue): AggregateNode;
173
179
  /**
174
180
  * Compute a linear regression regr_syy aggregate.
175
- * @param {import('../types.js').ExprValue} x The x expression to aggregate.
176
- * @param {import('../types.js').ExprValue} y The y expression to aggregate.
181
+ * @param {ExprValue} x The x expression to aggregate.
182
+ * @param {ExprValue} y The y expression to aggregate.
177
183
  * @returns {AggregateNode} A SQL aggregate function call.
178
184
  */
179
- export function regrSYY(x: import("../types.js").ExprValue, y: import("../types.js").ExprValue): AggregateNode;
185
+ export function regrSYY(x: ExprValue, y: ExprValue): AggregateNode;
180
186
  /**
181
187
  * Compute a linear regression slope aggregate.
182
- * @param {import('../types.js').ExprValue} x The x expression to aggregate.
183
- * @param {import('../types.js').ExprValue} y The y expression to aggregate.
188
+ * @param {ExprValue} x The x expression to aggregate.
189
+ * @param {ExprValue} y The y expression to aggregate.
184
190
  * @returns {AggregateNode} A SQL aggregate function call.
185
191
  */
186
- export function regrSlope(x: import("../types.js").ExprValue, y: import("../types.js").ExprValue): AggregateNode;
192
+ export function regrSlope(x: ExprValue, y: ExprValue): AggregateNode;
187
193
  /**
188
194
  * Compute a skewness aggregate.
189
- * @param {import('../types.js').ExprValue} expr The expression to aggregate.
195
+ * @param {ExprValue} expr The expression to aggregate.
190
196
  * @returns {AggregateNode} A SQL aggregate function call.
191
197
  */
192
- export function skewness(expr: import("../types.js").ExprValue): AggregateNode;
198
+ export function skewness(expr: ExprValue): AggregateNode;
193
199
  /**
194
200
  * Compute a sample standard deviation aggregate.
195
- * @param {import('../types.js').ExprValue} expr The expression to aggregate.
201
+ * @param {ExprValue} expr The expression to aggregate.
196
202
  * @returns {AggregateNode} A SQL aggregate function call.
197
203
  */
198
- export function stddev(expr: import("../types.js").ExprValue): AggregateNode;
204
+ export function stddev(expr: ExprValue): AggregateNode;
199
205
  /**
200
206
  * Compute a population standard deviation aggregate.
201
- * @param {import('../types.js').ExprValue} expr The expression to aggregate.
207
+ * @param {ExprValue} expr The expression to aggregate.
202
208
  * @returns {AggregateNode} A SQL aggregate function call.
203
209
  */
204
- export function stddevPop(expr: import("../types.js").ExprValue): AggregateNode;
210
+ export function stddevPop(expr: ExprValue): AggregateNode;
205
211
  /**
206
212
  * Compute a string aggregation.
207
- * @param {import('../types.js').ExprValue} expr The expression to aggregate.
213
+ * @param {ExprValue} expr The expression to aggregate.
208
214
  * @returns {AggregateNode} A SQL aggregate function call.
209
215
  */
210
- export function stringAgg(expr: import("../types.js").ExprValue): AggregateNode;
216
+ export function stringAgg(expr: ExprValue): AggregateNode;
211
217
  /**
212
218
  * Compute a sum aggregate.
213
- * @param {import('../types.js').ExprValue} expr The expression to aggregate.
219
+ * @param {ExprValue} expr The expression to aggregate.
214
220
  * @returns {AggregateNode} A SQL aggregate function call.
215
221
  */
216
- export function sum(expr: import("../types.js").ExprValue): AggregateNode;
222
+ export function sum(expr: ExprValue): AggregateNode;
217
223
  /**
218
224
  * Compute a sample variance aggregate.
219
- * @param {import('../types.js').ExprValue} expr The expression to aggregate.
225
+ * @param {ExprValue} expr The expression to aggregate.
220
226
  * @returns {AggregateNode} A SQL aggregate function call.
221
227
  */
222
- export function variance(expr: import("../types.js").ExprValue): AggregateNode;
228
+ export function variance(expr: ExprValue): AggregateNode;
223
229
  /**
224
230
  * Compute a population variance aggregate.
225
- * @param {import('../types.js').ExprValue} expr The expression to aggregate.
231
+ * @param {ExprValue} expr The expression to aggregate.
226
232
  * @returns {AggregateNode} A SQL aggregate function call.
227
233
  */
228
- export function varPop(expr: import("../types.js").ExprValue): AggregateNode;
229
- import { AggregateNode } from '../ast/aggregate.js';
234
+ export function varPop(expr: ExprValue): AggregateNode;
235
+ import type { ExprValue } from '../types.js';
236
+ import type { AggregateNode } from '../ast/aggregate.js';
@@ -1,15 +1,13 @@
1
1
  /**
2
2
  * Create a new conditional CASE statement. If three arguments are provided,
3
- * acts like a ternary conditional (if, then else). If no arguments are
3
+ * acts like a ternary conditional (if, then, else). If no arguments are
4
4
  * provided, the chained `when` and `else` methods can be used to to complete
5
5
  * a conditional statement with WHEN/THEN and ELSE expressions.
6
- * @param {import('../types.js').ExprValue} [when]
7
- * A conditional WHEN expression.
8
- * @param {import('../types.js').ExprValue} [then]
9
- * A THEN value expression.
10
- * @param {import('../types.js').ExprValue} [other]
11
- * An ELSE expression.
6
+ * @param {ExprValue} [when] A conditional WHEN expression.
7
+ * @param {ExprValue} [then] A THEN value expression.
8
+ * @param {ExprValue} [other] An ELSE expression.
12
9
  * @returns {CaseNode}
13
10
  */
14
- export function cond(when?: import("../types.js").ExprValue, then?: import("../types.js").ExprValue, other?: import("../types.js").ExprValue): CaseNode;
11
+ export function cond(when?: ExprValue, then?: ExprValue, other?: ExprValue): CaseNode;
12
+ import type { ExprValue } from '../types.js';
15
13
  import { CaseNode } from '../ast/case.js';
@@ -1,9 +1,11 @@
1
1
  /**
2
2
  * Create a column reference.
3
- * @param {string | import('../types.js').ParamLike} name The column name,
3
+ * @param {string | ParamLike} name The column name,
4
4
  * as a string or as a dynamic parameter.
5
5
  * @param {string | string[] | TableRefNode} [table] The table reference.
6
- * @returns {import('../ast/column-ref.js').ColumnRefNode}
6
+ * @returns {ColumnRefNode}
7
7
  */
8
- export function column(name: string | import("../types.js").ParamLike, table?: string | string[] | TableRefNode): import("../ast/column-ref.js").ColumnRefNode;
8
+ export function column(name: string | ParamLike, table?: string | string[] | TableRefNode): ColumnRefNode;
9
+ import type { ParamLike } from '../types.js';
9
10
  import { TableRefNode } from '../ast/table-ref.js';
11
+ import type { ColumnRefNode } from '../ast/column-ref.js';
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Create a common table expression (CTE) to include within a WITH clause.
3
+ * @param {string} name The common table expression (CTE) name.
4
+ * @param {Query} query The common table expression (CTE) query.
5
+ * @param {boolean | null} [materialized] The common table expression (CTE)
6
+ * materialization flag. If `true`, forces materialization of the CTE.
7
+ * If `false`, materialization is not performed. Otherwise (for example, if
8
+ * `undefined` or `null`), materialization is decided by the database.
9
+ * @returns {WithClauseNode}
10
+ */
11
+ export function cte(name: string, query: Query, materialized?: boolean | null): WithClauseNode;
12
+ import { Query } from '../ast/query.js';
13
+ import { WithClauseNode } from '../ast/with.js';
@@ -7,38 +7,39 @@
7
7
  export function interval(unit: string, steps: number): IntervalNode;
8
8
  /**
9
9
  * Given a date/time value, return the milliseconds since the UNIX epoch.
10
- * @param {import('../types.js').ExprValue} expr The date/time expression.
10
+ * @param {ExprValue} expr The date/time expression.
11
11
  * @returns {FunctionNode}
12
12
  */
13
- export function epoch_ms(expr: import("../types.js").ExprValue): FunctionNode;
13
+ export function epoch_ms(expr: ExprValue): FunctionNode;
14
14
  /**
15
15
  * Perform data binning according to the provided interval unit and steps.
16
- * @param {import('../types.js').ExprValue} expr The date/time expression to bin.
16
+ * @param {ExprValue} expr The date/time expression to bin.
17
17
  * @param {string} unit The datetime interval unit to bin by.
18
18
  * @param {number} [steps=1] The number of interval steps.
19
19
  * @returns {FunctionNode}
20
20
  */
21
- export function dateBin(expr: import("../types.js").ExprValue, unit: string, steps?: number): FunctionNode;
21
+ export function dateBin(expr: ExprValue, unit: string, steps?: number): FunctionNode;
22
22
  /**
23
23
  * Map date/times to a month value, all within the same year for comparison.
24
24
  * The resulting value is still date-typed.
25
- * @param {import('../types.js').ExprValue} expr The date/time expression.
25
+ * @param {ExprValue} expr The date/time expression.
26
26
  * @returns {FunctionNode}
27
27
  */
28
- export function dateMonth(expr: import("../types.js").ExprValue): FunctionNode;
28
+ export function dateMonth(expr: ExprValue): FunctionNode;
29
29
  /**
30
30
  * Map date/times to a month and day value, all within the same year for
31
31
  * comparison. The resulting value is still date-typed.
32
- * @param {import('../types.js').ExprValue} expr The date/time expression.
32
+ * @param {ExprValue} expr The date/time expression.
33
33
  * @returns {FunctionNode}
34
34
  */
35
- export function dateMonthDay(expr: import("../types.js").ExprValue): FunctionNode;
35
+ export function dateMonthDay(expr: ExprValue): FunctionNode;
36
36
  /**
37
37
  * Map date/times to a day of the month value, all within the same year and month
38
38
  * for comparison. The resulting value is still date-typed.
39
- * @param {import('../types.js').ExprValue} expr The date/time expression.
39
+ * @param {ExprValue} expr The date/time expression.
40
40
  * @returns {FunctionNode}
41
41
  */
42
- export function dateDay(expr: import("../types.js").ExprValue): FunctionNode;
42
+ export function dateDay(expr: ExprValue): FunctionNode;
43
43
  import { IntervalNode } from '../ast/interval.js';
44
- import { FunctionNode } from '../ast/function.js';
44
+ import type { ExprValue } from '../types.js';
45
+ import type { FunctionNode } from '../ast/function.js';
@@ -1,93 +1,95 @@
1
1
  /**
2
2
  * Return true if the floating point value is not a number, false otherwise.
3
- * @param {import('../types.js').ExprValue} expr The input number.
4
- * @returns {import('../ast/function.js').FunctionNode}
3
+ * @param {ExprValue} expr The input number.
4
+ * @returns {FunctionNode}
5
5
  */
6
- export function isNaN(expr: import("../types.js").ExprValue): import("../ast/function.js").FunctionNode;
6
+ export function isNaN(expr: ExprValue): FunctionNode;
7
7
  /**
8
8
  * Return true if the floating point value is finite, false otherwise.
9
- * @param {import('../types.js').ExprValue} expr The input number.
10
- * @returns {import('../ast/function.js').FunctionNode}
9
+ * @param {ExprValue} expr The input number.
10
+ * @returns {FunctionNode}
11
11
  */
12
- export function isFinite(expr: import("../types.js").ExprValue): import("../ast/function.js").FunctionNode;
12
+ export function isFinite(expr: ExprValue): FunctionNode;
13
13
  /**
14
14
  * Return true if the floating point value is infinite, false otherwise.
15
- * @param {import('../types.js').ExprValue} expr The input number.
16
- * @returns {import('../ast/function.js').FunctionNode}
15
+ * @param {ExprValue} expr The input number.
16
+ * @returns {FunctionNode}
17
17
  */
18
- export function isInfinite(expr: import("../types.js").ExprValue): import("../ast/function.js").FunctionNode;
18
+ export function isInfinite(expr: ExprValue): FunctionNode;
19
19
  /**
20
20
  * Selects the largest value.
21
- * @param {...import('../types.js').ExprValue} expr The input expressions.
22
- * @returns {import('../ast/function.js').FunctionNode}
21
+ * @param {...ExprValue} expr The input expressions.
22
+ * @returns {FunctionNode}
23
23
  */
24
- export function greatest(...expr: import("../types.js").ExprValue[]): import("../ast/function.js").FunctionNode;
24
+ export function greatest(...expr: ExprValue[]): FunctionNode;
25
25
  /**
26
26
  * Selects the smallest value.
27
- * @param {...import('../types.js').ExprValue} expr The input expressions.
28
- * @returns {import('../ast/function.js').FunctionNode}
27
+ * @param {...ExprValue} expr The input expressions.
28
+ * @returns {FunctionNode}
29
29
  */
30
- export function least(...expr: import("../types.js").ExprValue[]): import("../ast/function.js").FunctionNode;
30
+ export function least(...expr: ExprValue[]): FunctionNode;
31
31
  /**
32
32
  * Compute the exponentional function `e ** expr`.
33
- * @param {import('../types.js').ExprValue} expr The input number.
34
- * @returns {import('../ast/function.js').FunctionNode}
33
+ * @param {ExprValue} expr The input number.
34
+ * @returns {FunctionNode}
35
35
  */
36
- export function exp(expr: import("../types.js").ExprValue): import("../ast/function.js").FunctionNode;
36
+ export function exp(expr: ExprValue): FunctionNode;
37
37
  /**
38
38
  * Compute a base 10 logarithm.
39
- * @param {import('../types.js').ExprValue} expr The input number.
40
- * @returns {import('../ast/function.js').FunctionNode}
39
+ * @param {ExprValue} expr The input number.
40
+ * @returns {FunctionNode}
41
41
  */
42
- export function log(expr: import("../types.js").ExprValue): import("../ast/function.js").FunctionNode;
42
+ export function log(expr: ExprValue): FunctionNode;
43
43
  /**
44
44
  * Compute a natural logarithm.
45
- * @param {import('../types.js').ExprValue} expr The input number.
46
- * @returns {import('../ast/function.js').FunctionNode}
45
+ * @param {ExprValue} expr The input number.
46
+ * @returns {FunctionNode}
47
47
  */
48
- export function ln(expr: import("../types.js").ExprValue): import("../ast/function.js").FunctionNode;
48
+ export function ln(expr: ExprValue): FunctionNode;
49
49
  /**
50
50
  * Compute the sign of a number.
51
- * @param {import('../types.js').ExprValue} expr The input number.
52
- * @returns {import('../ast/function.js').FunctionNode}
51
+ * @param {ExprValue} expr The input number.
52
+ * @returns {FunctionNode}
53
53
  */
54
- export function sign(expr: import("../types.js").ExprValue): import("../ast/function.js").FunctionNode;
54
+ export function sign(expr: ExprValue): FunctionNode;
55
55
  /**
56
56
  * Compute the absolute value of a number.
57
- * @param {import('../types.js').ExprValue} expr The input number.
58
- * @returns {import('../ast/function.js').FunctionNode}
57
+ * @param {ExprValue} expr The input number.
58
+ * @returns {FunctionNode}
59
59
  */
60
- export function abs(expr: import("../types.js").ExprValue): import("../ast/function.js").FunctionNode;
60
+ export function abs(expr: ExprValue): FunctionNode;
61
61
  /**
62
62
  * Compute the square root of a number.
63
- * @param {import('../types.js').ExprValue} expr The input number.
64
- * @returns {import('../ast/function.js').FunctionNode}
63
+ * @param {ExprValue} expr The input number.
64
+ * @returns {FunctionNode}
65
65
  */
66
- export function sqrt(expr: import("../types.js").ExprValue): import("../ast/function.js").FunctionNode;
66
+ export function sqrt(expr: ExprValue): FunctionNode;
67
67
  /**
68
68
  * Rounds the number up.
69
- * @param {import('../types.js').ExprValue} expr The input number.
70
- * @returns {import('../ast/function.js').FunctionNode}
69
+ * @param {ExprValue} expr The input number.
70
+ * @returns {FunctionNode}
71
71
  */
72
- export function ceil(expr: import("../types.js").ExprValue): import("../ast/function.js").FunctionNode;
72
+ export function ceil(expr: ExprValue): FunctionNode;
73
73
  /**
74
74
  * Rounds the number down.
75
- * @param {import('../types.js').ExprValue} expr The input number.
76
- * @returns {import('../ast/function.js').FunctionNode}
75
+ * @param {ExprValue} expr The input number.
76
+ * @returns {FunctionNode}
77
77
  */
78
- export function floor(expr: import("../types.js").ExprValue): import("../ast/function.js").FunctionNode;
78
+ export function floor(expr: ExprValue): FunctionNode;
79
79
  /**
80
80
  * Round to the given decimal places.
81
- * @param {import('../types.js').ExprValue} expr The input number.
82
- * @param {import('../types.js').ExprValue} [places] The decimal places.
81
+ * @param {ExprValue} expr The input number.
82
+ * @param {ExprValue} [places] The decimal places.
83
83
  * Negative values are allowed, to round to tens, hundreds, etc.
84
84
  * If unspecified, defaults to zero.
85
- * @returns {import('../ast/function.js').FunctionNode}
85
+ * @returns {FunctionNode}
86
86
  */
87
- export function round(expr: import("../types.js").ExprValue, places?: import("../types.js").ExprValue): import("../ast/function.js").FunctionNode;
87
+ export function round(expr: ExprValue, places?: ExprValue): FunctionNode;
88
88
  /**
89
89
  * Truncates the number.
90
- * @param {import('../types.js').ExprValue} expr The input number.
91
- * @returns {import('../ast/function.js').FunctionNode}
90
+ * @param {ExprValue} expr The input number.
91
+ * @returns {FunctionNode}
92
92
  */
93
- export function trunc(expr: import("../types.js").ExprValue): import("../ast/function.js").FunctionNode;
93
+ export function trunc(expr: ExprValue): FunctionNode;
94
+ import type { ExprValue } from '../types.js';
95
+ import type { FunctionNode } from '../ast/function.js';