@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.
- package/package.json +5 -9
- package/src/ast/aggregate.js +50 -8
- package/src/ast/collate.js +33 -0
- package/src/ast/from.js +13 -4
- package/src/ast/node.js +13 -0
- package/src/ast/query.js +54 -22
- package/src/ast/sample.js +3 -3
- package/src/ast/subquery.js +23 -0
- package/src/ast/verbatim.js +8 -1
- package/src/ast/window-frame.js +107 -0
- package/src/ast/window.js +65 -99
- package/src/constants.js +5 -6
- package/src/functions/collate.js +16 -0
- package/src/functions/datetime.js +1 -11
- package/src/functions/interval.js +83 -0
- package/src/functions/literal.js +3 -2
- package/src/functions/window-frame.js +61 -0
- package/src/index.js +12 -4
- package/src/load/load.js +1 -1
- package/src/transforms/bin-date.js +2 -1
- package/src/transforms/filter-query.js +44 -0
- package/src/types.ts +9 -0
- package/src/visit/clone.js +53 -0
- package/src/visit/recurse.js +17 -5
- package/src/visit/rewrite.js +3 -11
- package/src/visit/walk.js +0 -1
- package/tsconfig.json +3 -7
- package/LICENSE +0 -47
- package/dist/types/ast/aggregate.d.ts +0 -71
- package/dist/types/ast/between-op.d.ts +0 -46
- package/dist/types/ast/binary-op.d.ts +0 -28
- package/dist/types/ast/case.d.ts +0 -67
- package/dist/types/ast/cast.d.ts +0 -21
- package/dist/types/ast/column-param.d.ts +0 -23
- package/dist/types/ast/column-ref.d.ts +0 -40
- package/dist/types/ast/fragment.d.ts +0 -14
- package/dist/types/ast/from.d.ts +0 -21
- package/dist/types/ast/function.d.ts +0 -21
- package/dist/types/ast/in-op.d.ts +0 -21
- package/dist/types/ast/interval.d.ts +0 -21
- package/dist/types/ast/literal.d.ts +0 -15
- package/dist/types/ast/logical-op.d.ts +0 -46
- package/dist/types/ast/node.d.ts +0 -24
- package/dist/types/ast/order-by.d.ts +0 -29
- package/dist/types/ast/param.d.ts +0 -20
- package/dist/types/ast/query.d.ts +0 -320
- package/dist/types/ast/sample.d.ts +0 -42
- package/dist/types/ast/select.d.ts +0 -22
- package/dist/types/ast/table-ref.d.ts +0 -25
- package/dist/types/ast/unary-op.d.ts +0 -39
- package/dist/types/ast/verbatim.d.ts +0 -9
- package/dist/types/ast/window.d.ts +0 -180
- package/dist/types/ast/with.d.ts +0 -32
- package/dist/types/constants.d.ts +0 -38
- package/dist/types/functions/aggregate.d.ts +0 -236
- package/dist/types/functions/case.d.ts +0 -13
- package/dist/types/functions/cast.d.ts +0 -26
- package/dist/types/functions/column.d.ts +0 -11
- package/dist/types/functions/cte.d.ts +0 -13
- package/dist/types/functions/datetime.d.ts +0 -45
- package/dist/types/functions/literal.d.ts +0 -16
- package/dist/types/functions/numeric.d.ts +0 -95
- package/dist/types/functions/operators.d.ts +0 -200
- package/dist/types/functions/order-by.d.ts +0 -18
- package/dist/types/functions/spatial.d.ts +0 -38
- package/dist/types/functions/sql-template-tag.d.ts +0 -15
- package/dist/types/functions/string.d.ts +0 -57
- package/dist/types/functions/table-ref.d.ts +0 -9
- package/dist/types/functions/util.d.ts +0 -8
- package/dist/types/functions/window.d.ts +0 -89
- package/dist/types/index-types.d.ts +0 -2
- package/dist/types/index.d.ts +0 -59
- package/dist/types/load/create.d.ts +0 -8
- package/dist/types/load/extension.d.ts +0 -1
- package/dist/types/load/load.d.ts +0 -12
- package/dist/types/load/sql-from.d.ts +0 -11
- package/dist/types/transforms/bin-1d.d.ts +0 -15
- package/dist/types/transforms/bin-2d.d.ts +0 -19
- package/dist/types/transforms/bin-date.d.ts +0 -44
- package/dist/types/transforms/bin-histogram.d.ts +0 -51
- package/dist/types/transforms/bin-linear-1d.d.ts +0 -12
- package/dist/types/transforms/bin-linear-2d.d.ts +0 -19
- package/dist/types/transforms/line-density.d.ts +0 -24
- package/dist/types/transforms/m4.d.ts +0 -21
- package/dist/types/transforms/scales.d.ts +0 -1
- package/dist/types/transforms/util/bin-step.d.ts +0 -61
- package/dist/types/transforms/util/time-interval.d.ts +0 -13
- package/dist/types/types.d.ts +0 -62
- package/dist/types/util/ast.d.ts +0 -61
- package/dist/types/util/function.d.ts +0 -56
- package/dist/types/util/string.d.ts +0 -3
- package/dist/types/util/type-check.d.ts +0 -22
- package/dist/types/visit/recurse.d.ts +0 -28
- package/dist/types/visit/rewrite.d.ts +0 -10
- package/dist/types/visit/visitors.d.ts +0 -34
- package/dist/types/visit/walk.d.ts +0 -10
- package/jsconfig.json +0 -11
|
@@ -1,200 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Logical and (AND) operator.
|
|
3
|
-
* @param {...ExprVarArgs} clauses The input expressions.
|
|
4
|
-
* @returns {AndNode}
|
|
5
|
-
*/
|
|
6
|
-
export function and(...clauses: ExprVarArgs[]): AndNode<any>;
|
|
7
|
-
/**
|
|
8
|
-
* Logical or (OR) operator.
|
|
9
|
-
* @param {...ExprVarArgs} clauses The input expressions.
|
|
10
|
-
* @returns {OrNode}
|
|
11
|
-
*/
|
|
12
|
-
export function or(...clauses: ExprVarArgs[]): OrNode<any>;
|
|
13
|
-
/**
|
|
14
|
-
* Logical not (NOT) operator.
|
|
15
|
-
* @param {ExprValue} expr The expression to negate.
|
|
16
|
-
* @returns {UnaryOpNode}
|
|
17
|
-
*/
|
|
18
|
-
export function not(expr: ExprValue): UnaryOpNode;
|
|
19
|
-
/**
|
|
20
|
-
* Null check (IS NULL) operator.
|
|
21
|
-
* @param {ExprValue} expr The expression to test.
|
|
22
|
-
* @returns {UnaryPosftixOpNode}
|
|
23
|
-
*/
|
|
24
|
-
export function isNull(expr: ExprValue): UnaryPosftixOpNode;
|
|
25
|
-
/**
|
|
26
|
-
* Non-null check (IS NOT NULL) operator.
|
|
27
|
-
* @param {ExprValue} expr The expression to test.
|
|
28
|
-
* @returns {UnaryPosftixOpNode}
|
|
29
|
-
*/
|
|
30
|
-
export function isNotNull(expr: ExprValue): UnaryPosftixOpNode;
|
|
31
|
-
/**
|
|
32
|
-
* Bitwise not (~) operator.
|
|
33
|
-
* @param {ExprValue} expr The input expression.
|
|
34
|
-
* @returns {UnaryOpNode}
|
|
35
|
-
*/
|
|
36
|
-
export function bitNot(expr: ExprValue): UnaryOpNode;
|
|
37
|
-
/**
|
|
38
|
-
* Bitwise and (&) operator.
|
|
39
|
-
* @param {ExprValue} left The left argument.
|
|
40
|
-
* @param {ExprValue} right The right argument.
|
|
41
|
-
* @returns {BinaryOpNode}
|
|
42
|
-
*/
|
|
43
|
-
export function bitAnd(left: ExprValue, right: ExprValue): BinaryOpNode;
|
|
44
|
-
/**
|
|
45
|
-
* Bitwise or (|) operator.
|
|
46
|
-
* @param {ExprValue} left The left argument.
|
|
47
|
-
* @param {ExprValue} right The right argument.
|
|
48
|
-
* @returns {BinaryOpNode}
|
|
49
|
-
*/
|
|
50
|
-
export function bitOr(left: ExprValue, right: ExprValue): BinaryOpNode;
|
|
51
|
-
/**
|
|
52
|
-
* Bit shift left (<<) operator.
|
|
53
|
-
* @param {ExprValue} left The left argument.
|
|
54
|
-
* @param {ExprValue} right The right argument.
|
|
55
|
-
* @returns {BinaryOpNode}
|
|
56
|
-
*/
|
|
57
|
-
export function bitLeft(left: ExprValue, right: ExprValue): BinaryOpNode;
|
|
58
|
-
/**
|
|
59
|
-
* Bit shift right (>>) operator.
|
|
60
|
-
* @param {ExprValue} left The left argument.
|
|
61
|
-
* @param {ExprValue} right The right argument.
|
|
62
|
-
* @returns {BinaryOpNode}
|
|
63
|
-
*/
|
|
64
|
-
export function bitRight(left: ExprValue, right: ExprValue): BinaryOpNode;
|
|
65
|
-
/**
|
|
66
|
-
* Addition (+) operator.
|
|
67
|
-
* @param {ExprValue} left The left argument.
|
|
68
|
-
* @param {ExprValue} right The right argument.
|
|
69
|
-
* @returns {BinaryOpNode}
|
|
70
|
-
*/
|
|
71
|
-
export function add(left: ExprValue, right: ExprValue): BinaryOpNode;
|
|
72
|
-
/**
|
|
73
|
-
* Subtraction (-) operator.
|
|
74
|
-
* @param {ExprValue} left The left argument.
|
|
75
|
-
* @param {ExprValue} right The right argument.
|
|
76
|
-
* @returns {BinaryOpNode}
|
|
77
|
-
*/
|
|
78
|
-
export function sub(left: ExprValue, right: ExprValue): BinaryOpNode;
|
|
79
|
-
/**
|
|
80
|
-
* Multiplication (*) operator.
|
|
81
|
-
* @param {ExprValue} left The left argument.
|
|
82
|
-
* @param {ExprValue} right The right argument.
|
|
83
|
-
* @returns {BinaryOpNode}
|
|
84
|
-
*/
|
|
85
|
-
export function mul(left: ExprValue, right: ExprValue): BinaryOpNode;
|
|
86
|
-
/**
|
|
87
|
-
* Division (/) operator.
|
|
88
|
-
* @param {ExprValue} left The left argument.
|
|
89
|
-
* @param {ExprValue} right The right argument.
|
|
90
|
-
* @returns {BinaryOpNode}
|
|
91
|
-
*/
|
|
92
|
-
export function div(left: ExprValue, right: ExprValue): BinaryOpNode;
|
|
93
|
-
/**
|
|
94
|
-
* Integer division (//) operator.
|
|
95
|
-
* @param {ExprValue} left The left argument.
|
|
96
|
-
* @param {ExprValue} right The right argument.
|
|
97
|
-
* @returns {BinaryOpNode}
|
|
98
|
-
*/
|
|
99
|
-
export function idiv(left: ExprValue, right: ExprValue): BinaryOpNode;
|
|
100
|
-
/**
|
|
101
|
-
* Modulo (%) operator.
|
|
102
|
-
* @param {ExprValue} left The left argument.
|
|
103
|
-
* @param {ExprValue} right The right argument.
|
|
104
|
-
* @returns {BinaryOpNode}
|
|
105
|
-
*/
|
|
106
|
-
export function mod(left: ExprValue, right: ExprValue): BinaryOpNode;
|
|
107
|
-
/**
|
|
108
|
-
* Exponentiation (**) operator.
|
|
109
|
-
* @param {ExprValue} left The left argument.
|
|
110
|
-
* @param {ExprValue} right The right argument.
|
|
111
|
-
* @returns {BinaryOpNode}
|
|
112
|
-
*/
|
|
113
|
-
export function pow(left: ExprValue, right: ExprValue): BinaryOpNode;
|
|
114
|
-
/**
|
|
115
|
-
* Equality comparision (=) operator.
|
|
116
|
-
* @param {ExprValue} left The left argument.
|
|
117
|
-
* @param {ExprValue} right The right argument.
|
|
118
|
-
* @returns {BinaryOpNode}
|
|
119
|
-
*/
|
|
120
|
-
export function eq(left: ExprValue, right: ExprValue): BinaryOpNode;
|
|
121
|
-
/**
|
|
122
|
-
* Non-equality comparision (<>) operator.
|
|
123
|
-
* @param {ExprValue} left The left argument.
|
|
124
|
-
* @param {ExprValue} right The right argument.
|
|
125
|
-
* @returns {BinaryOpNode}
|
|
126
|
-
*/
|
|
127
|
-
export function neq(left: ExprValue, right: ExprValue): BinaryOpNode;
|
|
128
|
-
/**
|
|
129
|
-
* Less-than comparision (<) operator.
|
|
130
|
-
* @param {ExprValue} left The left argument.
|
|
131
|
-
* @param {ExprValue} right The right argument.
|
|
132
|
-
* @returns {BinaryOpNode}
|
|
133
|
-
*/
|
|
134
|
-
export function lt(left: ExprValue, right: ExprValue): BinaryOpNode;
|
|
135
|
-
/**
|
|
136
|
-
* Greater-than comparision (>) operator.
|
|
137
|
-
* @param {ExprValue} left The left argument.
|
|
138
|
-
* @param {ExprValue} right The right argument.
|
|
139
|
-
* @returns {BinaryOpNode}
|
|
140
|
-
*/
|
|
141
|
-
export function gt(left: ExprValue, right: ExprValue): BinaryOpNode;
|
|
142
|
-
/**
|
|
143
|
-
* Less-than or equal comparision (<=) operator.
|
|
144
|
-
* @param {ExprValue} left The left argument.
|
|
145
|
-
* @param {ExprValue} right The right argument.
|
|
146
|
-
* @returns {BinaryOpNode}
|
|
147
|
-
*/
|
|
148
|
-
export function lte(left: ExprValue, right: ExprValue): BinaryOpNode;
|
|
149
|
-
/**
|
|
150
|
-
* Greater-than or equal comparision (>=) operator.
|
|
151
|
-
* @param {ExprValue} left The left argument.
|
|
152
|
-
* @param {ExprValue} right The right argument.
|
|
153
|
-
* @returns {BinaryOpNode}
|
|
154
|
-
*/
|
|
155
|
-
export function gte(left: ExprValue, right: ExprValue): BinaryOpNode;
|
|
156
|
-
/**
|
|
157
|
-
* Null-inclusive non-equality (IS DISTINCT FROM) operator.
|
|
158
|
-
* @param {ExprValue} left The left argument.
|
|
159
|
-
* @param {ExprValue} right The right argument.
|
|
160
|
-
* @returns {BinaryOpNode}
|
|
161
|
-
*/
|
|
162
|
-
export function isDistinct(left: ExprValue, right: ExprValue): BinaryOpNode;
|
|
163
|
-
/**
|
|
164
|
-
* Null-inclusive equality (IS NOT DISTINCT FROM) operator.
|
|
165
|
-
* @param {ExprValue} left The left argument.
|
|
166
|
-
* @param {ExprValue} right The right argument.
|
|
167
|
-
* @returns {BinaryOpNode}
|
|
168
|
-
*/
|
|
169
|
-
export function isNotDistinct(left: ExprValue, right: ExprValue): BinaryOpNode;
|
|
170
|
-
/**
|
|
171
|
-
* Range inclusion (BETWEEN) operator.
|
|
172
|
-
* @param {ExprValue} expr The expression to test.
|
|
173
|
-
* @param {ExprValue[]} extent The range extent.
|
|
174
|
-
* @returns {BetweenOpNode}
|
|
175
|
-
*/
|
|
176
|
-
export function isBetween(expr: ExprValue, extent: ExprValue[]): BetweenOpNode;
|
|
177
|
-
/**
|
|
178
|
-
* Range exclusion (NOT BETWEEN) operator.
|
|
179
|
-
* @param {ExprValue} expr The expression to test.
|
|
180
|
-
* @param {ExprValue[]} extent The range extent.
|
|
181
|
-
* @returns {NotBetweenOpNode}
|
|
182
|
-
*/
|
|
183
|
-
export function isNotBetween(expr: ExprValue, extent: ExprValue[]): NotBetweenOpNode;
|
|
184
|
-
/**
|
|
185
|
-
* Set inclusion (IN) operator.
|
|
186
|
-
* @param {ExprValue} expr The expression to test.
|
|
187
|
-
* @param {ExprValue[]} values The included values.
|
|
188
|
-
* @returns {InOpNode}
|
|
189
|
-
*/
|
|
190
|
-
export function isIn(expr: ExprValue, values: ExprValue[]): InOpNode;
|
|
191
|
-
import type { ExprVarArgs } from '../types.js';
|
|
192
|
-
import { AndNode } from '../ast/logical-op.js';
|
|
193
|
-
import { OrNode } from '../ast/logical-op.js';
|
|
194
|
-
import type { ExprValue } from '../types.js';
|
|
195
|
-
import { UnaryOpNode } from '../ast/unary-op.js';
|
|
196
|
-
import { UnaryPosftixOpNode } from '../ast/unary-op.js';
|
|
197
|
-
import { BinaryOpNode } from '../ast/binary-op.js';
|
|
198
|
-
import { BetweenOpNode } from '../ast/between-op.js';
|
|
199
|
-
import { NotBetweenOpNode } from '../ast/between-op.js';
|
|
200
|
-
import { InOpNode } from '../ast/in-op.js';
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Indicate ascending sort order for an expression.
|
|
3
|
-
* @param {ExprValue} expr An expression to order by.
|
|
4
|
-
* @param {boolean | undefined} [nullsFirst] Flag indicating if null values
|
|
5
|
-
* should be sorted first.
|
|
6
|
-
* @returns {OrderByNode}
|
|
7
|
-
*/
|
|
8
|
-
export function asc(expr: ExprValue, nullsFirst?: boolean | undefined): OrderByNode;
|
|
9
|
-
/**
|
|
10
|
-
* Indicate descending sort order for an expression.
|
|
11
|
-
* @param {ExprValue} expr An expression to order by.
|
|
12
|
-
* @param {boolean | undefined} [nullsFirst] Flag indicating if null values
|
|
13
|
-
* should be sorted first.
|
|
14
|
-
* @returns {OrderByNode}
|
|
15
|
-
*/
|
|
16
|
-
export function desc(expr: ExprValue, nullsFirst?: boolean | undefined): OrderByNode;
|
|
17
|
-
import type { ExprValue } from '../types.js';
|
|
18
|
-
import { OrderByNode } from '../ast/order-by.js';
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Function that converts geometry data to GeoJSON format.
|
|
3
|
-
* @param {ExprValue} expr The input expression.
|
|
4
|
-
* @returns {FunctionNode}
|
|
5
|
-
*/
|
|
6
|
-
export function geojson(expr: ExprValue): FunctionNode;
|
|
7
|
-
/**
|
|
8
|
-
* Function that returns a spatial x position (using ST_X).
|
|
9
|
-
* @param {ExprValue} expr The input expression.
|
|
10
|
-
* @returns {FunctionNode}
|
|
11
|
-
*/
|
|
12
|
-
export function x(expr: ExprValue): FunctionNode;
|
|
13
|
-
/**
|
|
14
|
-
* Function that returns a spatial y position (using ST_Y).
|
|
15
|
-
* @param {ExprValue} expr The input expression.
|
|
16
|
-
* @returns {FunctionNode}
|
|
17
|
-
*/
|
|
18
|
-
export function y(expr: ExprValue): FunctionNode;
|
|
19
|
-
/**
|
|
20
|
-
* Function that returns the centroid point for geometry data.
|
|
21
|
-
* @param {ExprValue} expr The input expression.
|
|
22
|
-
* @returns {FunctionNode}
|
|
23
|
-
*/
|
|
24
|
-
export function centroid(expr: ExprValue): FunctionNode;
|
|
25
|
-
/**
|
|
26
|
-
* Function that returns the centroid x-coordinate for geometry data.
|
|
27
|
-
* @param {ExprValue} expr The input expression.
|
|
28
|
-
* @returns {FunctionNode}
|
|
29
|
-
*/
|
|
30
|
-
export function centroidX(expr: ExprValue): FunctionNode;
|
|
31
|
-
/**
|
|
32
|
-
* Function that returns yhe centroid y-coordinate for geometry data.
|
|
33
|
-
* @param {ExprValue} expr The input expression.
|
|
34
|
-
* @returns {FunctionNode}
|
|
35
|
-
*/
|
|
36
|
-
export function centroidY(expr: ExprValue): FunctionNode;
|
|
37
|
-
import type { ExprValue } from '../types.js';
|
|
38
|
-
import type { FunctionNode } from '../ast/function.js';
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @typedef { ExprNode | ParamLike | string | number | boolean | Date } TemplateValue
|
|
3
|
-
*/
|
|
4
|
-
/**
|
|
5
|
-
* Template tag function for SQL fragments. Interpolated values
|
|
6
|
-
* may be strings, other SQL expression objects (such as column
|
|
7
|
-
* references), primitive values, or dynamic parameters.
|
|
8
|
-
* @param {TemplateStringsArray} strings Template string constants.
|
|
9
|
-
* @param {...TemplateValue} exprs Template expression values.
|
|
10
|
-
*/
|
|
11
|
-
export function sql(strings: TemplateStringsArray, ...exprs: TemplateValue[]): FragmentNode;
|
|
12
|
-
export type TemplateValue = ExprNode | ParamLike | string | number | boolean | Date;
|
|
13
|
-
import { FragmentNode } from '../ast/fragment.js';
|
|
14
|
-
import type { ExprNode } from '../ast/node.js';
|
|
15
|
-
import type { ParamLike } from '../types.js';
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Function that returns true if a string contains a regexp pattern,
|
|
3
|
-
* false otherwise.
|
|
4
|
-
* @param {ExprValue} string The string match against.
|
|
5
|
-
* @param {StringValue} pattern The regular expression pattern to match.
|
|
6
|
-
* @param {StringValue} [options] Regular expression options:
|
|
7
|
-
* 'c': case-sensitive matching
|
|
8
|
-
* 'i': case-insensitive matching
|
|
9
|
-
* 'l': match literals instead of regular expression tokens
|
|
10
|
-
* 'm', 'n', 'p': newline sensitive matching
|
|
11
|
-
* 'g': global replace, only available for regexp_replace
|
|
12
|
-
* 's': non-newline sensitive matching
|
|
13
|
-
* @returns {FunctionNode}
|
|
14
|
-
*/
|
|
15
|
-
export function regexp_matches(string: ExprValue, pattern: StringValue, options?: StringValue): FunctionNode;
|
|
16
|
-
/**
|
|
17
|
-
* Function that returns true if search_string is found within string.
|
|
18
|
-
* @param {ExprValue} string The string to match against.
|
|
19
|
-
* @param {StringValue} search_string The substring to search for.
|
|
20
|
-
* @returns {FunctionNode}
|
|
21
|
-
*/
|
|
22
|
-
export function contains(string: ExprValue, search_string: StringValue): FunctionNode;
|
|
23
|
-
/**
|
|
24
|
-
* Function that returns true if string begins with search_string.
|
|
25
|
-
* @param {ExprValue} string The string to match against.
|
|
26
|
-
* @param {StringValue} search_string The substring to search for.
|
|
27
|
-
* @returns {FunctionNode}
|
|
28
|
-
*/
|
|
29
|
-
export function prefix(string: ExprValue, search_string: StringValue): FunctionNode;
|
|
30
|
-
/**
|
|
31
|
-
* Function that returns true if string ends with search_string.
|
|
32
|
-
* @param {ExprValue} string The string to match against.
|
|
33
|
-
* @param {StringValue} search_string The substring to search for.
|
|
34
|
-
* @returns {FunctionNode}
|
|
35
|
-
*/
|
|
36
|
-
export function suffix(string: ExprValue, search_string: StringValue): FunctionNode;
|
|
37
|
-
/**
|
|
38
|
-
* Function that converts string to lower case.
|
|
39
|
-
* @param {ExprValue} string The string to convert.
|
|
40
|
-
* @returns {FunctionNode}
|
|
41
|
-
*/
|
|
42
|
-
export function lower(string: ExprValue): FunctionNode;
|
|
43
|
-
/**
|
|
44
|
-
* Function that converts string to upper case.
|
|
45
|
-
* @param {ExprValue} string The string to convert.
|
|
46
|
-
* @returns {FunctionNode}
|
|
47
|
-
*/
|
|
48
|
-
export function upper(string: ExprValue): FunctionNode;
|
|
49
|
-
/**
|
|
50
|
-
* Function that returns the number of characters in string.
|
|
51
|
-
* @param {ExprValue} value The string to measure.
|
|
52
|
-
* @returns {FunctionNode}
|
|
53
|
-
*/
|
|
54
|
-
export function length(value: ExprValue): FunctionNode;
|
|
55
|
-
import type { ExprValue } from '../types.js';
|
|
56
|
-
import type { StringValue } from '../types.js';
|
|
57
|
-
import type { FunctionNode } from '../ast/function.js';
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Returns a named table or view reference.
|
|
3
|
-
* @param {...(string | string[])} ids Table and namespace identifiers.
|
|
4
|
-
* For example 'name' or ['schema', 'name'].
|
|
5
|
-
* @returns {TableRefNode | undefined} A table reference, or undefined
|
|
6
|
-
* if the input identifier list is empty.
|
|
7
|
-
*/
|
|
8
|
-
export function tableRef(...ids: (string | string[])[]): TableRefNode | undefined;
|
|
9
|
-
import { TableRefNode } from '../ast/table-ref.js';
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Returns the first non-null argument.
|
|
3
|
-
* @param {...ExprValue} expr The input expressions.
|
|
4
|
-
* @returns {FunctionNode}
|
|
5
|
-
*/
|
|
6
|
-
export function coalesce(...expr: ExprValue[]): FunctionNode;
|
|
7
|
-
import type { ExprValue } from '../types.js';
|
|
8
|
-
import type { FunctionNode } from '../ast/function.js';
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Create a window function that returns the number of the current row
|
|
3
|
-
* within the partition, counting from 1.
|
|
4
|
-
* @returns {WindowNode}
|
|
5
|
-
*/
|
|
6
|
-
export function row_number(): WindowNode;
|
|
7
|
-
/**
|
|
8
|
-
* Create a window function that returns the rank of the current row with gaps.
|
|
9
|
-
* This is the same as the row_number of its first peer.
|
|
10
|
-
* @returns {WindowNode}
|
|
11
|
-
*/
|
|
12
|
-
export function rank(): WindowNode;
|
|
13
|
-
/**
|
|
14
|
-
* Create a window function that returns the rank of the current row without
|
|
15
|
-
* gaps. The function counts peer groups.
|
|
16
|
-
* @returns {WindowNode}
|
|
17
|
-
*/
|
|
18
|
-
export function dense_rank(): WindowNode;
|
|
19
|
-
/**
|
|
20
|
-
* Create a window function that returns the relative rank of the current row.
|
|
21
|
-
* Computed as (rank() - 1) / (total partition rows - 1).
|
|
22
|
-
* @returns {WindowNode}
|
|
23
|
-
*/
|
|
24
|
-
export function percent_rank(): WindowNode;
|
|
25
|
-
/**
|
|
26
|
-
* Create a window function that returns the cumulative distribution. Computed
|
|
27
|
-
* as (number of preceding or peer partition rows) / total partition rows.
|
|
28
|
-
* @returns {WindowNode}
|
|
29
|
-
*/
|
|
30
|
-
export function cume_dist(): WindowNode;
|
|
31
|
-
/**
|
|
32
|
-
* Create a window function that returns an integer ranging from 1 to the
|
|
33
|
-
* argument value, dividing the partition as equally as possible.
|
|
34
|
-
* @param {NumberValue} num_buckets The number of
|
|
35
|
-
* quantile buckets.
|
|
36
|
-
* @returns {WindowNode}
|
|
37
|
-
*/
|
|
38
|
-
export function ntile(num_buckets: NumberValue): WindowNode;
|
|
39
|
-
/**
|
|
40
|
-
* Create a window function that returns the expression evaluated at the row
|
|
41
|
-
* that is offset rows before the current row within the partition.
|
|
42
|
-
* If there is no such row, instead return default (which must be of the same
|
|
43
|
-
* type as the expression). Both offset and default are evaluated with respect
|
|
44
|
-
* to the current row. If omitted, offset defaults to 1 and default to null.
|
|
45
|
-
* @param {ExprValue} expr The expression to evaluate.
|
|
46
|
-
* @param {NumberValue} [offset] The row offset
|
|
47
|
-
* (default `1`).
|
|
48
|
-
* @param {*} [defaultValue] The default value (default `null`).
|
|
49
|
-
* @returns {WindowNode}
|
|
50
|
-
*/
|
|
51
|
-
export function lag(expr: ExprValue, offset?: NumberValue, defaultValue?: any): WindowNode;
|
|
52
|
-
/**
|
|
53
|
-
* Create a window function that returns the expression evaluated at the row
|
|
54
|
-
* that is offset rows after the current row within the partition.
|
|
55
|
-
* If there is no such row, instead return default (which must be of the same
|
|
56
|
-
* type as the expression). Both offset and default are evaluated with respect
|
|
57
|
-
* to the current row. If omitted, offset defaults to 1 and default to null.
|
|
58
|
-
* @param {ExprValue} expr The expression to evaluate.
|
|
59
|
-
* @param {NumberValue} [offset] The row offset
|
|
60
|
-
* (default `1`).
|
|
61
|
-
* @param {*} [defaultValue] The default value (default `null`).
|
|
62
|
-
* @returns {WindowNode}
|
|
63
|
-
*/
|
|
64
|
-
export function lead(expr: ExprValue, offset?: NumberValue, defaultValue?: any): WindowNode;
|
|
65
|
-
/**
|
|
66
|
-
* Create a window function that returns the expression evaluated at the row
|
|
67
|
-
* that is the first row of the window frame.
|
|
68
|
-
* @param {ExprValue} expr The expression to evaluate.
|
|
69
|
-
* @returns {WindowNode}
|
|
70
|
-
*/
|
|
71
|
-
export function first_value(expr: ExprValue): WindowNode;
|
|
72
|
-
/**
|
|
73
|
-
* Create a window function that returns the expression evaluated at the row
|
|
74
|
-
* that is the last row of the window frame.
|
|
75
|
-
* @param {ExprValue} expr The expression to evaluate.
|
|
76
|
-
* @returns {WindowNode}
|
|
77
|
-
*/
|
|
78
|
-
export function last_value(expr: ExprValue): WindowNode;
|
|
79
|
-
/**
|
|
80
|
-
* Create a window function that returns the expression evaluated at the
|
|
81
|
-
* nth row of the window frame (counting from 1), or null if no such row.
|
|
82
|
-
* @param {ExprValue} expr The expression to evaluate.
|
|
83
|
-
* @param {NumberValue} nth The 1-based window frame index.
|
|
84
|
-
* @returns {WindowNode}
|
|
85
|
-
*/
|
|
86
|
-
export function nth_value(expr: ExprValue, nth: NumberValue): WindowNode;
|
|
87
|
-
import type { WindowNode } from '../ast/window.js';
|
|
88
|
-
import type { NumberValue } from '../types.js';
|
|
89
|
-
import type { ExprValue } from '../types.js';
|
package/dist/types/index.d.ts
DELETED
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
export { AggregateNode } from "./ast/aggregate.js";
|
|
2
|
-
export { BinaryOpNode } from "./ast/binary-op.js";
|
|
3
|
-
export { CastNode } from "./ast/cast.js";
|
|
4
|
-
export { FragmentNode } from "./ast/fragment.js";
|
|
5
|
-
export { FromClauseNode } from "./ast/from.js";
|
|
6
|
-
export { FunctionNode } from "./ast/function.js";
|
|
7
|
-
export { InOpNode } from "./ast/in-op.js";
|
|
8
|
-
export { IntervalNode } from "./ast/interval.js";
|
|
9
|
-
export { LiteralNode } from "./ast/literal.js";
|
|
10
|
-
export { OrderByNode } from "./ast/order-by.js";
|
|
11
|
-
export { ParamNode } from "./ast/param.js";
|
|
12
|
-
export { SampleClauseNode } from "./ast/sample.js";
|
|
13
|
-
export { SelectClauseNode } from "./ast/select.js";
|
|
14
|
-
export { VerbatimNode } from "./ast/verbatim.js";
|
|
15
|
-
export { WithClauseNode } from "./ast/with.js";
|
|
16
|
-
export { cond } from "./functions/case.js";
|
|
17
|
-
export { column } from "./functions/column.js";
|
|
18
|
-
export { cte } from "./functions/cte.js";
|
|
19
|
-
export { literal } from "./functions/literal.js";
|
|
20
|
-
export { sql } from "./functions/sql-template-tag.js";
|
|
21
|
-
export { coalesce } from "./functions/util.js";
|
|
22
|
-
export { rewrite } from "./visit/rewrite.js";
|
|
23
|
-
export { walk } from "./visit/walk.js";
|
|
24
|
-
export { loadExtension } from "./load/extension.js";
|
|
25
|
-
export { bin1d } from "./transforms/bin-1d.js";
|
|
26
|
-
export { bin2d } from "./transforms/bin-2d.js";
|
|
27
|
-
export { binDate } from "./transforms/bin-date.js";
|
|
28
|
-
export { binHistogram } from "./transforms/bin-histogram.js";
|
|
29
|
-
export { binLinear1d } from "./transforms/bin-linear-1d.js";
|
|
30
|
-
export { binLinear2d } from "./transforms/bin-linear-2d.js";
|
|
31
|
-
export { lineDensity } from "./transforms/line-density.js";
|
|
32
|
-
export { m4 } from "./transforms/m4.js";
|
|
33
|
-
export { scaleTransform } from "./transforms/scales.js";
|
|
34
|
-
export { isParamLike } from "./util/type-check.js";
|
|
35
|
-
export { timeInterval } from "./transforms/util/time-interval.js";
|
|
36
|
-
export { BetweenOpNode, NotBetweenOpNode } from "./ast/between-op.js";
|
|
37
|
-
export { CaseNode, WhenNode } from "./ast/case.js";
|
|
38
|
-
export { ColumnParamNode, isColumnParam } from "./ast/column-param.js";
|
|
39
|
-
export { ColumnRefNode, ColumnNameRefNode, isColumnRef } from "./ast/column-ref.js";
|
|
40
|
-
export { AndNode, OrNode } from "./ast/logical-op.js";
|
|
41
|
-
export { SQLNode, ExprNode, isNode } from "./ast/node.js";
|
|
42
|
-
export { DescribeQuery, Query, SelectQuery, SetOperation, isDescribeQuery, isQuery, isSelectQuery } from "./ast/query.js";
|
|
43
|
-
export { TableRefNode, isTableRef } from "./ast/table-ref.js";
|
|
44
|
-
export { UnaryOpNode, UnaryPosftixOpNode } from "./ast/unary-op.js";
|
|
45
|
-
export { WindowClauseNode, WindowDefNode, WindowFrameNode, WindowFunctionNode, WindowNode } from "./ast/window.js";
|
|
46
|
-
export { argmax, argmin, arrayAgg, avg, corr, count, covariance, covarPop, entropy, first, geomean, kurtosis, mad, max, median, min, mode, last, product, quantile, regrAvgX, regrAvgY, regrCount, regrIntercept, regrR2, regrSXX, regrSXY, regrSYY, regrSlope, skewness, stddev, stddevPop, stringAgg, sum, variance, varPop } from "./functions/aggregate.js";
|
|
47
|
-
export { cast, float32, float64, int32 } from "./functions/cast.js";
|
|
48
|
-
export { dateBin, dateMonth, dateMonthDay, dateDay, epoch_ms, interval } from "./functions/datetime.js";
|
|
49
|
-
export { abs, ceil, exp, floor, greatest, isFinite, isInfinite, isNaN, least, ln, log, round, sign, sqrt, trunc } from "./functions/numeric.js";
|
|
50
|
-
export { and, or, not, isNull, isNotNull, bitNot, bitAnd, bitOr, bitLeft, bitRight, add, sub, mul, div, idiv, mod, pow, eq, neq, lt, gt, lte, gte, isDistinct, isNotDistinct, isBetween, isNotBetween, isIn } from "./functions/operators.js";
|
|
51
|
-
export { asc, desc } from "./functions/order-by.js";
|
|
52
|
-
export { geojson, x, y, centroid, centroidX, centroidY } from "./functions/spatial.js";
|
|
53
|
-
export { regexp_matches, contains, prefix, suffix, lower, upper, length } from "./functions/string.js";
|
|
54
|
-
export { cume_dist, dense_rank, first_value, lag, last_value, lead, nth_value, ntile, percent_rank, rank, row_number } from "./functions/window.js";
|
|
55
|
-
export { collectAggregates, collectColumns, collectParams, isAggregateExpression } from "./visit/visitors.js";
|
|
56
|
-
export { createTable, createSchema } from "./load/create.js";
|
|
57
|
-
export { loadCSV, loadJSON, loadObjects, loadParquet, loadSpatial } from "./load/load.js";
|
|
58
|
-
export { asLiteral, asNode, asTableRef, asVerbatim, over } from "./util/ast.js";
|
|
59
|
-
export { binSpec, binStep } from "./transforms/util/bin-step.js";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export function loadExtension(name: any): string;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export function load(method: any, tableName: any, fileName: any, options?: {}, defaults?: {}): string;
|
|
2
|
-
export function loadCSV(tableName: any, fileName: any, options: any): string;
|
|
3
|
-
export function loadJSON(tableName: any, fileName: any, options: any): string;
|
|
4
|
-
export function loadParquet(tableName: any, fileName: any, options: any): string;
|
|
5
|
-
/**
|
|
6
|
-
* Load geometry data within a spatial file format.
|
|
7
|
-
* This method requires that the DuckDB spatial extension is loaded.
|
|
8
|
-
* Supports GeoJSON, TopoJSON, and other comomn spatial formats.
|
|
9
|
-
* For TopoJSON, wet the layer option to indicate the feature to extract.
|
|
10
|
-
*/
|
|
11
|
-
export function loadSpatial(tableName: any, fileName: any, options?: {}): string;
|
|
12
|
-
export function loadObjects(tableName: any, data: any, options?: {}): string;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Create a SQL query that embeds the given data for loading.
|
|
3
|
-
* @param {*} data The dataset as an array of objects.
|
|
4
|
-
* @param {object} [options] Loading options.
|
|
5
|
-
* @param {string[]|object} [options.columns] The columns to include.
|
|
6
|
-
* If not specified, the keys of the first data object are used.
|
|
7
|
-
* @returns {string} SQL query string to load data.
|
|
8
|
-
*/
|
|
9
|
-
export function sqlFrom(data: any, { columns }?: {
|
|
10
|
-
columns?: string[] | object;
|
|
11
|
-
}): string;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Compute binned values over a one-dimensional extent.
|
|
3
|
-
* @param {ExprValue} x The expression to bin.
|
|
4
|
-
* The expression must return numeric values. For example, to bin
|
|
5
|
-
* datetime values, the input expression might map them to numeric
|
|
6
|
-
* values such as milliseconds since the epoch.
|
|
7
|
-
* @param {number} lo The low value of the bin extent.
|
|
8
|
-
* @param {number} hi The high value of the bin extent.
|
|
9
|
-
* @param {number} bins The integer number of bins to use within the
|
|
10
|
-
* defined binning extent.
|
|
11
|
-
* @param {boolean} [reverse] Flag indicating if bins should be
|
|
12
|
-
* produced in reverse order from *hi* to *lo* (default `false`).
|
|
13
|
-
*/
|
|
14
|
-
export function bin1d(x: ExprValue, lo: number, hi: number, bins: number, reverse?: boolean): import("../index.js").BinaryOpNode;
|
|
15
|
-
import type { ExprValue } from '../types.js';
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Perform aggregation over a binned 2D domain. This method takes expressions
|
|
3
|
-
* for the (non-truncated) x and y bin values; these expressions should be
|
|
4
|
-
* in units of grid indices, but can contain fractional components. The
|
|
5
|
-
* resulting query performs grouping and aggregation over the binned domain,
|
|
6
|
-
* and uses a 2D integer bin index of the form (xbin + num_xbins * ybin).
|
|
7
|
-
* @param {SelectQuery} q The input query. The FROM and WHERE clauses should
|
|
8
|
-
* be added to the query separately, either before or after this method.
|
|
9
|
-
* @param {ExprValue} xp The x bin expression.
|
|
10
|
-
* @param {ExprValue} yp The y bin expression.
|
|
11
|
-
* @param {Record<string, ExprValue>} aggs Named
|
|
12
|
-
* aggregate expressions over bins.
|
|
13
|
-
* @param {number} xn The number of bins along the x dimension
|
|
14
|
-
* @param {string[]} groupby Group by expressions.
|
|
15
|
-
* @returns {SelectQuery} The input query, with binning expressions added.
|
|
16
|
-
*/
|
|
17
|
-
export function bin2d(q: SelectQuery, xp: ExprValue, yp: ExprValue, aggs: Record<string, ExprValue>, xn: number, groupby: string[]): SelectQuery;
|
|
18
|
-
import type { SelectQuery } from '../ast/query.js';
|
|
19
|
-
import type { ExprValue } from '../types.js';
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @typedef {object} BinDateOptions
|
|
3
|
-
* @property {TimeUnit} [interval] A string indicating a time interval
|
|
4
|
-
* unit, such as 'year', 'day', or 'hour'.
|
|
5
|
-
* @property {number} [step] The number of time interval steps to
|
|
6
|
-
* take, such as 2 years or 3 months.
|
|
7
|
-
* @property {number} [offset] The number of bin steps (default 0) by
|
|
8
|
-
* which to offset the result.
|
|
9
|
-
* @property {number} [steps] The desired number of binning steps.
|
|
10
|
-
* This value is a hint, it does not guarantee an exact number of steps.
|
|
11
|
-
*/
|
|
12
|
-
/**
|
|
13
|
-
* Return a SQL expression for date/time bins.
|
|
14
|
-
* @param {ExprValue} field The column or expression to bin.
|
|
15
|
-
* @param {[Date|number, Date|number]} extent The min/max extent over which to bin.
|
|
16
|
-
* @param {BinDateOptions} [options] Datetime binning options.
|
|
17
|
-
* @returns {ExprNode}
|
|
18
|
-
*/
|
|
19
|
-
export function binDate(field: ExprValue, extent: [Date | number, Date | number], options?: BinDateOptions): ExprNode;
|
|
20
|
-
export type BinDateOptions = {
|
|
21
|
-
/**
|
|
22
|
-
* A string indicating a time interval
|
|
23
|
-
* unit, such as 'year', 'day', or 'hour'.
|
|
24
|
-
*/
|
|
25
|
-
interval?: TimeUnit;
|
|
26
|
-
/**
|
|
27
|
-
* The number of time interval steps to
|
|
28
|
-
* take, such as 2 years or 3 months.
|
|
29
|
-
*/
|
|
30
|
-
step?: number;
|
|
31
|
-
/**
|
|
32
|
-
* The number of bin steps (default 0) by
|
|
33
|
-
* which to offset the result.
|
|
34
|
-
*/
|
|
35
|
-
offset?: number;
|
|
36
|
-
/**
|
|
37
|
-
* The desired number of binning steps.
|
|
38
|
-
* This value is a hint, it does not guarantee an exact number of steps.
|
|
39
|
-
*/
|
|
40
|
-
steps?: number;
|
|
41
|
-
};
|
|
42
|
-
import type { ExprValue } from '../types.js';
|
|
43
|
-
import type { ExprNode } from '../ast/node.js';
|
|
44
|
-
import type { TimeUnit } from '../types.js';
|