@uwdata/mosaic-sql 0.16.2 → 0.17.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 (97) hide show
  1. package/package.json +5 -9
  2. package/src/ast/aggregate.js +50 -8
  3. package/src/ast/collate.js +33 -0
  4. package/src/ast/from.js +13 -4
  5. package/src/ast/node.js +13 -0
  6. package/src/ast/query.js +54 -22
  7. package/src/ast/sample.js +3 -3
  8. package/src/ast/subquery.js +23 -0
  9. package/src/ast/verbatim.js +8 -1
  10. package/src/ast/window-frame.js +107 -0
  11. package/src/ast/window.js +65 -99
  12. package/src/constants.js +5 -6
  13. package/src/functions/collate.js +16 -0
  14. package/src/functions/datetime.js +1 -11
  15. package/src/functions/interval.js +83 -0
  16. package/src/functions/literal.js +3 -2
  17. package/src/functions/window-frame.js +61 -0
  18. package/src/index.js +12 -4
  19. package/src/load/load.js +1 -1
  20. package/src/transforms/bin-date.js +2 -1
  21. package/src/transforms/filter-query.js +44 -0
  22. package/src/types.ts +9 -0
  23. package/src/visit/clone.js +53 -0
  24. package/src/visit/recurse.js +17 -5
  25. package/src/visit/rewrite.js +3 -11
  26. package/src/visit/walk.js +0 -1
  27. package/tsconfig.json +3 -7
  28. package/LICENSE +0 -47
  29. package/dist/types/ast/aggregate.d.ts +0 -71
  30. package/dist/types/ast/between-op.d.ts +0 -46
  31. package/dist/types/ast/binary-op.d.ts +0 -28
  32. package/dist/types/ast/case.d.ts +0 -67
  33. package/dist/types/ast/cast.d.ts +0 -21
  34. package/dist/types/ast/column-param.d.ts +0 -23
  35. package/dist/types/ast/column-ref.d.ts +0 -40
  36. package/dist/types/ast/fragment.d.ts +0 -14
  37. package/dist/types/ast/from.d.ts +0 -21
  38. package/dist/types/ast/function.d.ts +0 -21
  39. package/dist/types/ast/in-op.d.ts +0 -21
  40. package/dist/types/ast/interval.d.ts +0 -21
  41. package/dist/types/ast/literal.d.ts +0 -15
  42. package/dist/types/ast/logical-op.d.ts +0 -46
  43. package/dist/types/ast/node.d.ts +0 -24
  44. package/dist/types/ast/order-by.d.ts +0 -29
  45. package/dist/types/ast/param.d.ts +0 -20
  46. package/dist/types/ast/query.d.ts +0 -320
  47. package/dist/types/ast/sample.d.ts +0 -42
  48. package/dist/types/ast/select.d.ts +0 -22
  49. package/dist/types/ast/table-ref.d.ts +0 -25
  50. package/dist/types/ast/unary-op.d.ts +0 -39
  51. package/dist/types/ast/verbatim.d.ts +0 -9
  52. package/dist/types/ast/window.d.ts +0 -180
  53. package/dist/types/ast/with.d.ts +0 -32
  54. package/dist/types/constants.d.ts +0 -38
  55. package/dist/types/functions/aggregate.d.ts +0 -236
  56. package/dist/types/functions/case.d.ts +0 -13
  57. package/dist/types/functions/cast.d.ts +0 -26
  58. package/dist/types/functions/column.d.ts +0 -11
  59. package/dist/types/functions/cte.d.ts +0 -13
  60. package/dist/types/functions/datetime.d.ts +0 -45
  61. package/dist/types/functions/literal.d.ts +0 -16
  62. package/dist/types/functions/numeric.d.ts +0 -95
  63. package/dist/types/functions/operators.d.ts +0 -200
  64. package/dist/types/functions/order-by.d.ts +0 -18
  65. package/dist/types/functions/spatial.d.ts +0 -38
  66. package/dist/types/functions/sql-template-tag.d.ts +0 -15
  67. package/dist/types/functions/string.d.ts +0 -57
  68. package/dist/types/functions/table-ref.d.ts +0 -9
  69. package/dist/types/functions/util.d.ts +0 -8
  70. package/dist/types/functions/window.d.ts +0 -89
  71. package/dist/types/index-types.d.ts +0 -2
  72. package/dist/types/index.d.ts +0 -59
  73. package/dist/types/load/create.d.ts +0 -8
  74. package/dist/types/load/extension.d.ts +0 -1
  75. package/dist/types/load/load.d.ts +0 -12
  76. package/dist/types/load/sql-from.d.ts +0 -11
  77. package/dist/types/transforms/bin-1d.d.ts +0 -15
  78. package/dist/types/transforms/bin-2d.d.ts +0 -19
  79. package/dist/types/transforms/bin-date.d.ts +0 -44
  80. package/dist/types/transforms/bin-histogram.d.ts +0 -51
  81. package/dist/types/transforms/bin-linear-1d.d.ts +0 -12
  82. package/dist/types/transforms/bin-linear-2d.d.ts +0 -19
  83. package/dist/types/transforms/line-density.d.ts +0 -24
  84. package/dist/types/transforms/m4.d.ts +0 -21
  85. package/dist/types/transforms/scales.d.ts +0 -1
  86. package/dist/types/transforms/util/bin-step.d.ts +0 -61
  87. package/dist/types/transforms/util/time-interval.d.ts +0 -13
  88. package/dist/types/types.d.ts +0 -62
  89. package/dist/types/util/ast.d.ts +0 -61
  90. package/dist/types/util/function.d.ts +0 -56
  91. package/dist/types/util/string.d.ts +0 -3
  92. package/dist/types/util/type-check.d.ts +0 -22
  93. package/dist/types/visit/recurse.d.ts +0 -28
  94. package/dist/types/visit/rewrite.d.ts +0 -10
  95. package/dist/types/visit/visitors.d.ts +0 -34
  96. package/dist/types/visit/walk.d.ts +0 -10
  97. package/jsconfig.json +0 -11
@@ -1,32 +0,0 @@
1
- export class WithClauseNode extends SQLNode {
2
- /**
3
- * Instantiate a with clause node for a common table expression (CTE).
4
- * @param {string} name The common table expression (CTE) name.
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.
10
- */
11
- constructor(name: string, query: Query, materialized?: boolean | null);
12
- /**
13
- * The common table expression (CTE) name.
14
- * @type {string}
15
- * @readonly
16
- */
17
- readonly name: string;
18
- /**
19
- * The common table expression (CTE) query.
20
- * @type {Query}
21
- * @readonly
22
- */
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;
30
- }
31
- import { SQLNode } from './node.js';
32
- import type { Query } from './query.js';
@@ -1,38 +0,0 @@
1
- export const COLUMN_REF: "COLUMN_REF";
2
- export const COLUMN_PARAM: "COLUMN_PARAM";
3
- export const TABLE_REF: "TABLE_REF";
4
- export const LITERAL: "LITERAL";
5
- export const INTERVAL: "INTERVAL";
6
- export const ORDER_BY: "ORDER_BY";
7
- export const CAST: "CAST";
8
- export const CASE: "CASE";
9
- export const WHEN: "WHEN";
10
- export const UNARY_OPERATOR: "UNARY";
11
- export const UNARY_POSTFIX_OPERATOR: "UNARY_POSTFIX";
12
- export const BINARY_OPERATOR: "BINARY";
13
- export const BETWEEN_OPERATOR: "BETWEEN";
14
- export const NOT_BETWEEN_OPERATOR: "NOT_BETWEEN";
15
- export const LOGICAL_OPERATOR: "LOGICAL_OPERATOR";
16
- export const IN_OPERATOR: "IN";
17
- export const FUNCTION: "FUNCTION";
18
- export const AGGREGATE: "AGGREGATE";
19
- export const WINDOW: "WINDOW";
20
- export const WINDOW_DEF: "WINDOW_DEF";
21
- export const WINDOW_FRAME: "WINDOW_FRAME";
22
- export const EXPRESSION: "EXPRESSION";
23
- export const FRAGMENT: "FRAGMENT";
24
- export const VERBATIM: "VERBATIM";
25
- export const PARAM: "PARAM";
26
- export const WITH_CLAUSE: "WITH_CLAUSE";
27
- export const SELECT_CLAUSE: "SELECT_CLAUSE";
28
- export const FROM_CLAUSE: "FROM_CLAUSE";
29
- export const WHERE_CLAUSE: "WHERE_CLAUSE";
30
- export const SAMPLE_CLAUSE: "SAMPLE_CLAUSE";
31
- export const GROUPBY_CLAUSE: "GROUPBY_CLAUSE";
32
- export const HAVING_CLAUSE: "HAVING_CLAUSE";
33
- export const WINDOW_CLAUSE: "WINDOW_CLAUSE";
34
- export const QUALIFY_CLAUSE: "QUALIFY_CLAUSE";
35
- export const ORDERBY_CLAUSE: "ORDERBY_CLAUSE";
36
- export const SELECT_QUERY: "SELECT_QUERY";
37
- export const DESCRIBE_QUERY: "DESCRIBE_QUERY";
38
- export const SET_OPERATION: "SET_OPERATION";
@@ -1,236 +0,0 @@
1
- /**
2
- * Compute an arg_max aggregate.
3
- * @param {ExprValue} y The argument to return.
4
- * @param {ExprValue} x The expression to maximize.
5
- * @returns {AggregateNode} A SQL aggregate function call.
6
- */
7
- export function argmax(y: ExprValue, x: ExprValue): AggregateNode;
8
- /**
9
- * Compute an arg_min aggregate.
10
- * @param {ExprValue} y The argument to return.
11
- * @param {ExprValue} x The expression to minimize.
12
- * @returns {AggregateNode} A SQL aggregate function call.
13
- */
14
- export function argmin(y: ExprValue, x: ExprValue): AggregateNode;
15
- /**
16
- * Compute an array aggregation.
17
- * @param {ExprValue} expr The expression to aggregate.
18
- * @returns {AggregateNode} A SQL aggregate function call.
19
- */
20
- export function arrayAgg(expr: ExprValue): AggregateNode;
21
- /**
22
- * Compute an average aggregate.
23
- * @param {ExprValue} expr The expression to aggregate.
24
- * @returns {AggregateNode} A SQL aggregate function call.
25
- */
26
- export function avg(expr: ExprValue): AggregateNode;
27
- /**
28
- * Compute a correlation aggregate.
29
- * @param {ExprValue} x The x expression to aggregate.
30
- * @param {ExprValue} y The y expression to aggregate.
31
- * @returns {AggregateNode} A SQL aggregate function call.
32
- */
33
- export function corr(x: ExprValue, y: ExprValue): AggregateNode;
34
- /**
35
- * Compute a count aggregate.
36
- * @param {ExprValue} [expr] An optional expression
37
- * to count. If specified, only non-null expression values are counted.
38
- * If omitted, all rows within a group are counted.
39
- * @returns {AggregateNode} A SQL aggregate function call.
40
- */
41
- export function count(expr?: ExprValue): AggregateNode;
42
- /**
43
- * Compute a sample covariance aggregate.
44
- * @param {ExprValue} x The x expression to aggregate.
45
- * @param {ExprValue} y The y expression to aggregate.
46
- * @returns {AggregateNode} A SQL aggregate function call.
47
- */
48
- export function covariance(x: ExprValue, y: ExprValue): AggregateNode;
49
- /**
50
- * Compute a population covariance aggregate.
51
- * @param {ExprValue} x The x expression to aggregate.
52
- * @param {ExprValue} y The y expression to aggregate.
53
- * @returns {AggregateNode} A SQL aggregate function call.
54
- */
55
- export function covarPop(x: ExprValue, y: ExprValue): AggregateNode;
56
- /**
57
- * Compute an entropy aggregate.
58
- * @param {ExprValue} expr The expression to aggregate.
59
- * @returns {AggregateNode} A SQL aggregate function call.
60
- */
61
- export function entropy(expr: ExprValue): AggregateNode;
62
- /**
63
- * Compute a first aggregate.
64
- * @param {ExprValue} expr The expression to aggregate.
65
- * @returns {AggregateNode} A SQL aggregate function call.
66
- */
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;
74
- /**
75
- * Compute a sample kurtosis aggregate.
76
- * @param {ExprValue} expr The expression to aggregate.
77
- * @returns {AggregateNode} A SQL aggregate function call.
78
- */
79
- export function kurtosis(expr: ExprValue): AggregateNode;
80
- /**
81
- * Compute a median absolute deviation (MAD) aggregate.
82
- * @param {ExprValue} expr The expression to aggregate.
83
- * @returns {AggregateNode} A SQL aggregate function call.
84
- */
85
- export function mad(expr: ExprValue): AggregateNode;
86
- /**
87
- * Compute a maximum aggregate.
88
- * @param {ExprValue} expr The expression to aggregate.
89
- * @returns {AggregateNode} A SQL aggregate function call.
90
- */
91
- export function max(expr: ExprValue): AggregateNode;
92
- /**
93
- * Compute a median aggregate.
94
- * @param {ExprValue} expr The expression to aggregate.
95
- * @returns {AggregateNode} A SQL aggregate function call.
96
- */
97
- export function median(expr: ExprValue): AggregateNode;
98
- /**
99
- * Compute a minimum aggregate.
100
- * @param {ExprValue} expr The expression to aggregate.
101
- * @returns {AggregateNode} A SQL aggregate function call.
102
- */
103
- export function min(expr: ExprValue): AggregateNode;
104
- /**
105
- * Compute a mode aggregate.
106
- * @param {ExprValue} expr The expression to aggregate.
107
- * @returns {AggregateNode} A SQL aggregate function call.
108
- */
109
- export function mode(expr: ExprValue): AggregateNode;
110
- /**
111
- * Compute a last aggregate.
112
- * @param {ExprValue} expr The expression to aggregate.
113
- * @returns {AggregateNode} A SQL aggregate function call.
114
- */
115
- export function last(expr: ExprValue): AggregateNode;
116
- /**
117
- * Compute a product aggregate.
118
- * @param {ExprValue} expr The expression to aggregate.
119
- * @returns {AggregateNode} A SQL aggregate function call.
120
- */
121
- export function product(expr: ExprValue): AggregateNode;
122
- /**
123
- * Compute a quantile aggregate.
124
- * @param {ExprValue} expr The expression to aggregate.
125
- * @param {ExprValue} p The quantile value.
126
- * @returns {AggregateNode} A SQL aggregate function call.
127
- */
128
- export function quantile(expr: ExprValue, p: ExprValue): AggregateNode;
129
- /**
130
- * Compute a linear regression reg_avgX aggregate.
131
- * @param {ExprValue} x The x expression to aggregate.
132
- * @param {ExprValue} y The y expression to aggregate.
133
- * @returns {AggregateNode} A SQL aggregate function call.
134
- */
135
- export function regrAvgX(x: ExprValue, y: ExprValue): AggregateNode;
136
- /**
137
- * Compute a linear regression reg_avgY aggregate.
138
- * @param {ExprValue} x The x expression to aggregate.
139
- * @param {ExprValue} y The y expression to aggregate.
140
- * @returns {AggregateNode} A SQL aggregate function call.
141
- */
142
- export function regrAvgY(x: ExprValue, y: ExprValue): AggregateNode;
143
- /**
144
- * Compute a linear regression count aggregate.
145
- * This returns the count of rows where both x and y are non-null.
146
- * @param {ExprValue} x The x expression to aggregate.
147
- * @param {ExprValue} y The y expression to aggregate.
148
- * @returns {AggregateNode} A SQL aggregate function call.
149
- */
150
- export function regrCount(x: ExprValue, y: ExprValue): AggregateNode;
151
- /**
152
- * Compute a linear regression intercept aggregate.
153
- * @param {ExprValue} x The x expression to aggregate.
154
- * @param {ExprValue} y The y expression to aggregate.
155
- * @returns {AggregateNode} A SQL aggregate function call.
156
- */
157
- export function regrIntercept(x: ExprValue, y: ExprValue): AggregateNode;
158
- /**
159
- * Compute a linear regression R^2 aggregate.
160
- * @param {ExprValue} x The x expression to aggregate.
161
- * @param {ExprValue} y The y expression to aggregate.
162
- * @returns {AggregateNode} A SQL aggregate function call.
163
- */
164
- export function regrR2(x: ExprValue, y: ExprValue): AggregateNode;
165
- /**
166
- * Compute a linear regression regr_sxx aggregate.
167
- * @param {ExprValue} x The x expression to aggregate.
168
- * @param {ExprValue} y The y expression to aggregate.
169
- * @returns {AggregateNode} A SQL aggregate function call.
170
- */
171
- export function regrSXX(x: ExprValue, y: ExprValue): AggregateNode;
172
- /**
173
- * Compute a linear regression regr_sxy aggregate.
174
- * @param {ExprValue} x The x expression to aggregate.
175
- * @param {ExprValue} y The y expression to aggregate.
176
- * @returns {AggregateNode} A SQL aggregate function call.
177
- */
178
- export function regrSXY(x: ExprValue, y: ExprValue): AggregateNode;
179
- /**
180
- * Compute a linear regression regr_syy aggregate.
181
- * @param {ExprValue} x The x expression to aggregate.
182
- * @param {ExprValue} y The y expression to aggregate.
183
- * @returns {AggregateNode} A SQL aggregate function call.
184
- */
185
- export function regrSYY(x: ExprValue, y: ExprValue): AggregateNode;
186
- /**
187
- * Compute a linear regression slope aggregate.
188
- * @param {ExprValue} x The x expression to aggregate.
189
- * @param {ExprValue} y The y expression to aggregate.
190
- * @returns {AggregateNode} A SQL aggregate function call.
191
- */
192
- export function regrSlope(x: ExprValue, y: ExprValue): AggregateNode;
193
- /**
194
- * Compute a skewness aggregate.
195
- * @param {ExprValue} expr The expression to aggregate.
196
- * @returns {AggregateNode} A SQL aggregate function call.
197
- */
198
- export function skewness(expr: ExprValue): AggregateNode;
199
- /**
200
- * Compute a sample standard deviation aggregate.
201
- * @param {ExprValue} expr The expression to aggregate.
202
- * @returns {AggregateNode} A SQL aggregate function call.
203
- */
204
- export function stddev(expr: ExprValue): AggregateNode;
205
- /**
206
- * Compute a population standard deviation aggregate.
207
- * @param {ExprValue} expr The expression to aggregate.
208
- * @returns {AggregateNode} A SQL aggregate function call.
209
- */
210
- export function stddevPop(expr: ExprValue): AggregateNode;
211
- /**
212
- * Compute a string aggregation.
213
- * @param {ExprValue} expr The expression to aggregate.
214
- * @returns {AggregateNode} A SQL aggregate function call.
215
- */
216
- export function stringAgg(expr: ExprValue): AggregateNode;
217
- /**
218
- * Compute a sum aggregate.
219
- * @param {ExprValue} expr The expression to aggregate.
220
- * @returns {AggregateNode} A SQL aggregate function call.
221
- */
222
- export function sum(expr: ExprValue): AggregateNode;
223
- /**
224
- * Compute a sample variance aggregate.
225
- * @param {ExprValue} expr The expression to aggregate.
226
- * @returns {AggregateNode} A SQL aggregate function call.
227
- */
228
- export function variance(expr: ExprValue): AggregateNode;
229
- /**
230
- * Compute a population variance aggregate.
231
- * @param {ExprValue} expr The expression to aggregate.
232
- * @returns {AggregateNode} A SQL aggregate function call.
233
- */
234
- export function varPop(expr: ExprValue): AggregateNode;
235
- import type { ExprValue } from '../types.js';
236
- import type { AggregateNode } from '../ast/aggregate.js';
@@ -1,13 +0,0 @@
1
- /**
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
4
- * provided, the chained `when` and `else` methods can be used to to complete
5
- * a conditional statement with WHEN/THEN and ELSE expressions.
6
- * @param {ExprValue} [when] A conditional WHEN expression.
7
- * @param {ExprValue} [then] A THEN value expression.
8
- * @param {ExprValue} [other] An ELSE expression.
9
- * @returns {CaseNode}
10
- */
11
- export function cond(when?: ExprValue, then?: ExprValue, other?: ExprValue): CaseNode;
12
- import type { ExprValue } from '../types.js';
13
- import { CaseNode } from '../ast/case.js';
@@ -1,26 +0,0 @@
1
- /**
2
- * Perform a type cast.
3
- * @param {*} expr The expression to type cast.
4
- * @param {string} type The type to cast to.
5
- * @returns {CastNode}
6
- */
7
- export function cast(expr: any, type: string): CastNode;
8
- /**
9
- * Cast an expression to a 32-bit integer type.
10
- * @param {*} expr The expression to type cast.
11
- * @returns {CastNode}
12
- */
13
- export function int32(expr: any): CastNode;
14
- /**
15
- * Cast an expression to a 32-bit floating point number type.
16
- * @param {*} expr The expression to type cast.
17
- * @returns {CastNode}
18
- */
19
- export function float32(expr: any): CastNode;
20
- /**
21
- * Cast an expression to a 64-bit floating point number type.
22
- * @param {*} expr The expression to type cast.
23
- * @returns {CastNode}
24
- */
25
- export function float64(expr: any): CastNode;
26
- import { CastNode } from '../ast/cast.js';
@@ -1,11 +0,0 @@
1
- /**
2
- * Create a column reference.
3
- * @param {string | ParamLike} name The column name,
4
- * as a string or as a dynamic parameter.
5
- * @param {string | string[] | TableRefNode} [table] The table reference.
6
- * @returns {ColumnRefNode}
7
- */
8
- export function column(name: string | ParamLike, table?: string | string[] | TableRefNode): ColumnRefNode;
9
- import type { ParamLike } from '../types.js';
10
- import type { TableRefNode } from '../ast/table-ref.js';
11
- import type { ColumnRefNode } from '../ast/column-ref.js';
@@ -1,13 +0,0 @@
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 type { Query } from '../ast/query.js';
13
- import { WithClauseNode } from '../ast/with.js';
@@ -1,45 +0,0 @@
1
- /**
2
- * Create a new interval.
3
- * @param {string} unit The interval unit, such as day or year.
4
- * @param {number} steps The number interval unit steps.
5
- * @returns {IntervalNode}
6
- */
7
- export function interval(unit: string, steps: number): IntervalNode;
8
- /**
9
- * Given a date/time value, return the milliseconds since the UNIX epoch.
10
- * @param {ExprValue} expr The date/time expression.
11
- * @returns {FunctionNode}
12
- */
13
- export function epoch_ms(expr: ExprValue): FunctionNode;
14
- /**
15
- * Perform data binning according to the provided interval unit and steps.
16
- * @param {ExprValue} expr The date/time expression to bin.
17
- * @param {string} unit The datetime interval unit to bin by.
18
- * @param {number} [steps=1] The number of interval steps.
19
- * @returns {FunctionNode}
20
- */
21
- export function dateBin(expr: ExprValue, unit: string, steps?: number): FunctionNode;
22
- /**
23
- * Map date/times to a month value, all within the same year for comparison.
24
- * The resulting value is still date-typed.
25
- * @param {ExprValue} expr The date/time expression.
26
- * @returns {FunctionNode}
27
- */
28
- export function dateMonth(expr: ExprValue): FunctionNode;
29
- /**
30
- * Map date/times to a month and day value, all within the same year for
31
- * comparison. The resulting value is still date-typed.
32
- * @param {ExprValue} expr The date/time expression.
33
- * @returns {FunctionNode}
34
- */
35
- export function dateMonthDay(expr: ExprValue): FunctionNode;
36
- /**
37
- * Map date/times to a day of the month value, all within the same year and month
38
- * for comparison. The resulting value is still date-typed.
39
- * @param {ExprValue} expr The date/time expression.
40
- * @returns {FunctionNode}
41
- */
42
- export function dateDay(expr: ExprValue): FunctionNode;
43
- import { IntervalNode } from '../ast/interval.js';
44
- import type { ExprValue } from '../types.js';
45
- import type { FunctionNode } from '../ast/function.js';
@@ -1,16 +0,0 @@
1
- /**
2
- * Return a SQL AST node for a literal value. The supported types are
3
- * null, string, number, boolean, Date, and RegExp. Otherwise, the
4
- * input value will be directly coerced to a string.
5
- * @param {*} value The literal value.
6
- * @returns {LiteralNode}
7
- */
8
- export function literal(value: any): LiteralNode;
9
- /**
10
- * Return a SQL AST node for verbatim string content.
11
- * @param {string} value The verbatim value.
12
- * @returns {VerbatimNode}
13
- */
14
- export function verbatim(value: string): VerbatimNode;
15
- import { LiteralNode } from '../ast/literal.js';
16
- import { VerbatimNode } from '../ast/verbatim.js';
@@ -1,95 +0,0 @@
1
- /**
2
- * Return true if the floating point value is not a number, false otherwise.
3
- * @param {ExprValue} expr The input number.
4
- * @returns {FunctionNode}
5
- */
6
- export function isNaN(expr: ExprValue): FunctionNode;
7
- /**
8
- * Return true if the floating point value is finite, false otherwise.
9
- * @param {ExprValue} expr The input number.
10
- * @returns {FunctionNode}
11
- */
12
- export function isFinite(expr: ExprValue): FunctionNode;
13
- /**
14
- * Return true if the floating point value is infinite, false otherwise.
15
- * @param {ExprValue} expr The input number.
16
- * @returns {FunctionNode}
17
- */
18
- export function isInfinite(expr: ExprValue): FunctionNode;
19
- /**
20
- * Selects the largest value.
21
- * @param {...ExprValue} expr The input expressions.
22
- * @returns {FunctionNode}
23
- */
24
- export function greatest(...expr: ExprValue[]): FunctionNode;
25
- /**
26
- * Selects the smallest value.
27
- * @param {...ExprValue} expr The input expressions.
28
- * @returns {FunctionNode}
29
- */
30
- export function least(...expr: ExprValue[]): FunctionNode;
31
- /**
32
- * Compute the exponentional function `e ** expr`.
33
- * @param {ExprValue} expr The input number.
34
- * @returns {FunctionNode}
35
- */
36
- export function exp(expr: ExprValue): FunctionNode;
37
- /**
38
- * Compute a base 10 logarithm.
39
- * @param {ExprValue} expr The input number.
40
- * @returns {FunctionNode}
41
- */
42
- export function log(expr: ExprValue): FunctionNode;
43
- /**
44
- * Compute a natural logarithm.
45
- * @param {ExprValue} expr The input number.
46
- * @returns {FunctionNode}
47
- */
48
- export function ln(expr: ExprValue): FunctionNode;
49
- /**
50
- * Compute the sign of a number.
51
- * @param {ExprValue} expr The input number.
52
- * @returns {FunctionNode}
53
- */
54
- export function sign(expr: ExprValue): FunctionNode;
55
- /**
56
- * Compute the absolute value of a number.
57
- * @param {ExprValue} expr The input number.
58
- * @returns {FunctionNode}
59
- */
60
- export function abs(expr: ExprValue): FunctionNode;
61
- /**
62
- * Compute the square root of a number.
63
- * @param {ExprValue} expr The input number.
64
- * @returns {FunctionNode}
65
- */
66
- export function sqrt(expr: ExprValue): FunctionNode;
67
- /**
68
- * Rounds the number up.
69
- * @param {ExprValue} expr The input number.
70
- * @returns {FunctionNode}
71
- */
72
- export function ceil(expr: ExprValue): FunctionNode;
73
- /**
74
- * Rounds the number down.
75
- * @param {ExprValue} expr The input number.
76
- * @returns {FunctionNode}
77
- */
78
- export function floor(expr: ExprValue): FunctionNode;
79
- /**
80
- * Round to the given decimal places.
81
- * @param {ExprValue} expr The input number.
82
- * @param {ExprValue} [places] The decimal places.
83
- * Negative values are allowed, to round to tens, hundreds, etc.
84
- * If unspecified, defaults to zero.
85
- * @returns {FunctionNode}
86
- */
87
- export function round(expr: ExprValue, places?: ExprValue): FunctionNode;
88
- /**
89
- * Truncates the number.
90
- * @param {ExprValue} expr The input number.
91
- * @returns {FunctionNode}
92
- */
93
- export function trunc(expr: ExprValue): FunctionNode;
94
- import type { ExprValue } from '../types.js';
95
- import type { FunctionNode } from '../ast/function.js';