@uwdata/mosaic-core 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 +7 -11
- package/src/Coordinator.js +0 -24
- package/src/index-types.ts +1 -0
- package/src/preagg/sufficient-statistics.js +1 -0
- package/tsconfig.json +6 -8
- package/LICENSE +0 -47
- package/dist/types/Coordinator.d.ts +0 -164
- package/dist/types/MosaicClient.d.ts +0 -143
- package/dist/types/Param.d.ts +0 -47
- package/dist/types/QueryConsolidator.d.ts +0 -9
- package/dist/types/QueryManager.d.ts +0 -91
- package/dist/types/Selection.d.ts +0 -235
- package/dist/types/SelectionClause.d.ts +0 -105
- package/dist/types/connectors/Connector.d.ts +0 -25
- package/dist/types/connectors/rest.d.ts +0 -13
- package/dist/types/connectors/socket.d.ts +0 -100
- package/dist/types/connectors/wasm.d.ts +0 -135
- package/dist/types/index-types.d.ts +0 -4
- package/dist/types/index.d.ts +0 -19
- package/dist/types/make-client.d.ts +0 -78
- package/dist/types/preagg/PreAggregator.d.ts +0 -180
- package/dist/types/preagg/preagg-columns.d.ts +0 -14
- package/dist/types/preagg/sufficient-statistics.d.ts +0 -13
- package/dist/types/types.d.ts +0 -63
- package/dist/types/util/AsyncDispatch.d.ts +0 -100
- package/dist/types/util/cache.d.ts +0 -17
- package/dist/types/util/decode-ipc.d.ts +0 -12
- package/dist/types/util/distinct.d.ts +0 -2
- package/dist/types/util/field-info.d.ts +0 -23
- package/dist/types/util/hash.d.ts +0 -1
- package/dist/types/util/is-activatable.d.ts +0 -6
- package/dist/types/util/is-arrow-table.d.ts +0 -8
- package/dist/types/util/js-type.d.ts +0 -7
- package/dist/types/util/priority-queue.d.ts +0 -37
- package/dist/types/util/query-result.d.ts +0 -44
- package/dist/types/util/selection-types.d.ts +0 -114
- package/dist/types/util/synchronizer.d.ts +0 -29
- package/dist/types/util/throttle.d.ts +0 -13
- package/dist/types/util/to-data-columns.d.ts +0 -29
- package/dist/types/util/void-logger.d.ts +0 -10
- package/jsconfig.json +0 -11
|
@@ -1,235 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Test if a value is a Selection instance.
|
|
3
|
-
* @param {*} x The value to test.
|
|
4
|
-
* @returns {x is Selection} True if the input is a Selection, false otherwise.
|
|
5
|
-
*/
|
|
6
|
-
export function isSelection(x: any): x is Selection;
|
|
7
|
-
/**
|
|
8
|
-
* Represents a dynamic set of query filter predicates.
|
|
9
|
-
*/
|
|
10
|
-
export class Selection extends Param {
|
|
11
|
-
/**
|
|
12
|
-
* Create a new Selection instance with an
|
|
13
|
-
* intersect (conjunction) resolution strategy.
|
|
14
|
-
* @param {object} [options] The selection options.
|
|
15
|
-
* @param {boolean} [options.cross=false] Boolean flag indicating
|
|
16
|
-
* cross-filtered resolution. If true, selection clauses will not
|
|
17
|
-
* be applied to the clients they are associated with.
|
|
18
|
-
* @param {boolean} [options.empty=false] Boolean flag indicating if a lack
|
|
19
|
-
* of clauses should correspond to an empty selection with no records. This
|
|
20
|
-
* setting determines the default selection state.
|
|
21
|
-
* @param {Selection|Selection[]} [options.include] Upstream selections whose
|
|
22
|
-
* clauses should be included as part of the new selection. Any clauses
|
|
23
|
-
* published to upstream selections will be relayed to the new selection.
|
|
24
|
-
* @returns {Selection} The new Selection instance.
|
|
25
|
-
*/
|
|
26
|
-
static intersect({ cross, empty, include }?: {
|
|
27
|
-
cross?: boolean;
|
|
28
|
-
empty?: boolean;
|
|
29
|
-
include?: Selection | Selection[];
|
|
30
|
-
}): Selection;
|
|
31
|
-
/**
|
|
32
|
-
* Create a new Selection instance with a
|
|
33
|
-
* union (disjunction) resolution strategy.
|
|
34
|
-
* @param {object} [options] The selection options.
|
|
35
|
-
* @param {boolean} [options.cross=false] Boolean flag indicating
|
|
36
|
-
* cross-filtered resolution. If true, selection clauses will not
|
|
37
|
-
* be applied to the clients they are associated with.
|
|
38
|
-
* @param {boolean} [options.empty=false] Boolean flag indicating if a lack
|
|
39
|
-
* of clauses should correspond to an empty selection with no records. This
|
|
40
|
-
* setting determines the default selection state.
|
|
41
|
-
* @param {Selection|Selection[]} [options.include] Upstream selections whose
|
|
42
|
-
* clauses should be included as part of the new selection. Any clauses
|
|
43
|
-
* published to upstream selections will be relayed to the new selection.
|
|
44
|
-
* @returns {Selection} The new Selection instance.
|
|
45
|
-
*/
|
|
46
|
-
static union({ cross, empty, include }?: {
|
|
47
|
-
cross?: boolean;
|
|
48
|
-
empty?: boolean;
|
|
49
|
-
include?: Selection | Selection[];
|
|
50
|
-
}): Selection;
|
|
51
|
-
/**
|
|
52
|
-
* Create a new Selection instance with a singular resolution strategy
|
|
53
|
-
* that keeps only the most recent selection clause.
|
|
54
|
-
* @param {object} [options] The selection options.
|
|
55
|
-
* @param {boolean} [options.cross=false] Boolean flag indicating
|
|
56
|
-
* cross-filtered resolution. If true, selection clauses will not
|
|
57
|
-
* be applied to the clients they are associated with.
|
|
58
|
-
* @param {boolean} [options.empty=false] Boolean flag indicating if a lack
|
|
59
|
-
* of clauses should correspond to an empty selection with no records. This
|
|
60
|
-
* setting determines the default selection state.
|
|
61
|
-
* @param {Selection|Selection[]} [options.include] Upstream selections whose
|
|
62
|
-
* clauses should be included as part of the new selection. Any clauses
|
|
63
|
-
* published to upstream selections will be relayed to the new selection.
|
|
64
|
-
* @returns {Selection} The new Selection instance.
|
|
65
|
-
*/
|
|
66
|
-
static single({ cross, empty, include }?: {
|
|
67
|
-
cross?: boolean;
|
|
68
|
-
empty?: boolean;
|
|
69
|
-
include?: Selection | Selection[];
|
|
70
|
-
}): Selection;
|
|
71
|
-
/**
|
|
72
|
-
* Create a new Selection instance with a
|
|
73
|
-
* cross-filtered intersect resolution strategy.
|
|
74
|
-
* @param {object} [options] The selection options.
|
|
75
|
-
* @param {boolean} [options.empty=false] Boolean flag indicating if a lack
|
|
76
|
-
* of clauses should correspond to an empty selection with no records. This
|
|
77
|
-
* setting determines the default selection state.
|
|
78
|
-
* @param {Selection|Selection[]} [options.include] Upstream selections whose
|
|
79
|
-
* clauses should be included as part of the new selection. Any clauses
|
|
80
|
-
* published to upstream selections will be relayed to the new selection.
|
|
81
|
-
* @returns {Selection} The new Selection instance.
|
|
82
|
-
*/
|
|
83
|
-
static crossfilter({ empty, include }?: {
|
|
84
|
-
empty?: boolean;
|
|
85
|
-
include?: Selection | Selection[];
|
|
86
|
-
}): Selection;
|
|
87
|
-
/**
|
|
88
|
-
* Create a new Selection instance.
|
|
89
|
-
* @param {SelectionResolver} [resolver] The selection resolution
|
|
90
|
-
* strategy to apply.
|
|
91
|
-
* @param {Selection[]} [include] Upstream selections whose clauses
|
|
92
|
-
* should be included as part of this selection. Any clauses published
|
|
93
|
-
* to these upstream selections will be relayed to this selection.
|
|
94
|
-
*/
|
|
95
|
-
constructor(resolver?: SelectionResolver, include?: Selection[]);
|
|
96
|
-
_resolved: any;
|
|
97
|
-
_resolver: SelectionResolver;
|
|
98
|
-
/** @type {Set<Selection>} */
|
|
99
|
-
_relay: Set<Selection>;
|
|
100
|
-
/**
|
|
101
|
-
* Create a cloned copy of this Selection instance.
|
|
102
|
-
* @returns {Selection} A clone of this selection.
|
|
103
|
-
*/
|
|
104
|
-
clone(): Selection;
|
|
105
|
-
/**
|
|
106
|
-
* Create a clone of this Selection with clauses corresponding
|
|
107
|
-
* to the provided source removed.
|
|
108
|
-
* @param {*} source The clause source to remove.
|
|
109
|
-
* @returns {Selection} A cloned and updated Selection.
|
|
110
|
-
*/
|
|
111
|
-
remove(source: any): Selection;
|
|
112
|
-
/**
|
|
113
|
-
* The selection clause resolver.
|
|
114
|
-
*/
|
|
115
|
-
get resolver(): SelectionResolver;
|
|
116
|
-
/**
|
|
117
|
-
* Indicate if this selection has a single resolution strategy.
|
|
118
|
-
*/
|
|
119
|
-
get single(): boolean;
|
|
120
|
-
/**
|
|
121
|
-
* The current array of selection clauses.
|
|
122
|
-
*/
|
|
123
|
-
get clauses(): any;
|
|
124
|
-
/**
|
|
125
|
-
* The current active (most recently updated) selection clause.
|
|
126
|
-
*/
|
|
127
|
-
get active(): any;
|
|
128
|
-
/**
|
|
129
|
-
* The value corresponding to a given source. Returns undefined if
|
|
130
|
-
* this selection does not include a clause from this source.
|
|
131
|
-
* @param {*} source The clause source to look up the value for.
|
|
132
|
-
*/
|
|
133
|
-
valueFor(source: any): any;
|
|
134
|
-
/**
|
|
135
|
-
* Emit an activate event with the given selection clause.
|
|
136
|
-
* @param {SelectionClause} clause The clause repesenting the potential activation.
|
|
137
|
-
*/
|
|
138
|
-
activate(clause: SelectionClause): void;
|
|
139
|
-
/**
|
|
140
|
-
* Update the selection with a new selection clause.
|
|
141
|
-
* @param {SelectionClause} clause The selection clause to add.
|
|
142
|
-
* @returns {this} This Selection instance.
|
|
143
|
-
*/
|
|
144
|
-
update(clause: SelectionClause): this;
|
|
145
|
-
/**
|
|
146
|
-
* Reset the selection state by removing all provided clauses. If no clause
|
|
147
|
-
* array is provided as an argument, all current clauses are removed. The
|
|
148
|
-
* reset method (if defined) is invoked on all corresponding clause sources.
|
|
149
|
-
* The reset is relayed to downstream selections that include this selection.
|
|
150
|
-
* @param {SelectionClause[]} [clauses] The clauses to remove. If
|
|
151
|
-
* unspecified, all current clauses are removed.
|
|
152
|
-
* @returns {this} This selection instance.
|
|
153
|
-
*/
|
|
154
|
-
reset(clauses?: SelectionClause[]): this;
|
|
155
|
-
/**
|
|
156
|
-
* Indicates if a selection clause should not be applied to a given client.
|
|
157
|
-
* The return value depends on the selection resolution strategy.
|
|
158
|
-
* @param {*} client The selection clause.
|
|
159
|
-
* @param {*} clause The client to test.
|
|
160
|
-
* @returns True if the client should be skipped, false otherwise.
|
|
161
|
-
*/
|
|
162
|
-
skip(client: any, clause: any): any;
|
|
163
|
-
/**
|
|
164
|
-
* Return a selection query predicate for the given client.
|
|
165
|
-
* @param {*} client The client whose data may be filtered.
|
|
166
|
-
* @param {boolean} [noSkip=false] Disable skipping of active
|
|
167
|
-
* cross-filtered sources. If set true, the source of the active
|
|
168
|
-
* clause in a cross-filtered selection will not be skipped.
|
|
169
|
-
* @returns {*} The query predicate for filtering client data,
|
|
170
|
-
* based on the current state of this selection.
|
|
171
|
-
*/
|
|
172
|
-
predicate(client: any, noSkip?: boolean): any;
|
|
173
|
-
}
|
|
174
|
-
/**
|
|
175
|
-
* Implements selection clause resolution strategies.
|
|
176
|
-
*/
|
|
177
|
-
export class SelectionResolver {
|
|
178
|
-
/**
|
|
179
|
-
* Create a new selection resolved instance.
|
|
180
|
-
* @param {object} [options] The resolution strategy options.
|
|
181
|
-
* @param {boolean} [options.union=false] Boolean flag to indicate a union strategy.
|
|
182
|
-
* If false, an intersection strategy is used.
|
|
183
|
-
* @param {boolean} [options.cross=false] Boolean flag to indicate cross-filtering.
|
|
184
|
-
* @param {boolean} [options.single=false] Boolean flag to indicate single clauses only.
|
|
185
|
-
* @param {boolean} [options.empty=false] Boolean flag indicating if a lack
|
|
186
|
-
* of clauses should correspond to an empty selection with no records. This
|
|
187
|
-
* setting determines the default selection state.
|
|
188
|
-
*/
|
|
189
|
-
constructor({ union, cross, single, empty }?: {
|
|
190
|
-
union?: boolean;
|
|
191
|
-
cross?: boolean;
|
|
192
|
-
single?: boolean;
|
|
193
|
-
empty?: boolean;
|
|
194
|
-
});
|
|
195
|
-
union: boolean;
|
|
196
|
-
cross: boolean;
|
|
197
|
-
single: boolean;
|
|
198
|
-
empty: boolean;
|
|
199
|
-
/**
|
|
200
|
-
* Resolve a list of selection clauses according to the resolution strategy.
|
|
201
|
-
* @param {*[]} clauseList An array of selection clauses.
|
|
202
|
-
* @param {*} clause A new selection clause to add.
|
|
203
|
-
* @returns {*[]} An updated array of selection clauses.
|
|
204
|
-
*/
|
|
205
|
-
resolve(clauseList: any[], clause: any, reset?: boolean): any[];
|
|
206
|
-
/**
|
|
207
|
-
* Indicates if a selection clause should not be applied to a given client.
|
|
208
|
-
* The return value depends on the resolution strategy.
|
|
209
|
-
* @param {*} client The selection clause.
|
|
210
|
-
* @param {*} clause The client to test.
|
|
211
|
-
* @returns True if the client should be skipped, false otherwise.
|
|
212
|
-
*/
|
|
213
|
-
skip(client: any, clause: any): any;
|
|
214
|
-
/**
|
|
215
|
-
* Return a selection query predicate for the given client.
|
|
216
|
-
* @param {import('./util/selection-types.js').SelectionClause[]} clauseList
|
|
217
|
-
* An array of selection clauses.
|
|
218
|
-
* @param {import('./util/selection-types.js').SelectionClause} active
|
|
219
|
-
* The current active selection clause.
|
|
220
|
-
* @param {MosaicClient} client The client whose data may be filtered.
|
|
221
|
-
* @returns {*} The query predicate for filtering client data,
|
|
222
|
-
* based on the current state of this selection.
|
|
223
|
-
*/
|
|
224
|
-
predicate(clauseList: import("./util/selection-types.js").SelectionClause[], active: import("./util/selection-types.js").SelectionClause, client: MosaicClient): any;
|
|
225
|
-
/**
|
|
226
|
-
* Returns a filter function for queued selection updates.
|
|
227
|
-
* @param {*} value The new event value that will be enqueued.
|
|
228
|
-
* @returns {(value: *) => boolean|null} A dispatch queue filter
|
|
229
|
-
* function, or null if all unemitted event values should be filtered.
|
|
230
|
-
*/
|
|
231
|
-
queueFilter(value: any): (value: any) => boolean | null;
|
|
232
|
-
}
|
|
233
|
-
import { Param } from './Param.js';
|
|
234
|
-
import type { SelectionClause } from './util/selection-types.js';
|
|
235
|
-
import type { MosaicClient } from './MosaicClient.js';
|
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @typedef {import('./util/selection-types.js').SelectionClause} SelectionClause
|
|
3
|
-
* @typedef {import('./util/selection-types.js').Scale} Scale
|
|
4
|
-
* @typedef {import('./util/selection-types.js').Extent} Extent
|
|
5
|
-
* @typedef {import('./util/selection-types.js').MatchMethod} MatchMethod
|
|
6
|
-
* @typedef {import('./util/selection-types.js').BinMethod} BinMethod
|
|
7
|
-
*/
|
|
8
|
-
/**
|
|
9
|
-
* Generate a selection clause for a single selected point value.
|
|
10
|
-
* @param {import('@uwdata/mosaic-sql').ExprValue} field The table column or expression to select.
|
|
11
|
-
* @param {*} value The selected value.
|
|
12
|
-
* @param {object} options Additional clause properties.
|
|
13
|
-
* @param {*} options.source The source component generating this clause.
|
|
14
|
-
* @param {Set<MosaicClient>} [options.clients] The Mosaic clients associated
|
|
15
|
-
* with this clause. These clients are not filtered by this clause in
|
|
16
|
-
* cross-filtering contexts.
|
|
17
|
-
* @returns {SelectionClause} The generated selection clause.
|
|
18
|
-
*/
|
|
19
|
-
export function clausePoint(field: import("@uwdata/mosaic-sql").ExprValue, value: any, { source, clients }: {
|
|
20
|
-
source: any;
|
|
21
|
-
clients?: Set<MosaicClient>;
|
|
22
|
-
}): SelectionClause;
|
|
23
|
-
/**
|
|
24
|
-
* Generate a selection clause for multiple selected point values.
|
|
25
|
-
* @param {import('@uwdata/mosaic-sql').ExprValue[]} fields The table columns or expressions to select.
|
|
26
|
-
* @param {any[][] | null | undefined} value The selected values, as an array of
|
|
27
|
-
* arrays. Each subarray contains values for each *fields* entry.
|
|
28
|
-
* @param {object} options Additional clause properties.
|
|
29
|
-
* @param {*} options.source The source component generating this clause.
|
|
30
|
-
* @param {Set<MosaicClient>} [options.clients] The Mosaic clients associated
|
|
31
|
-
* with this clause. These clients are not filtered by this clause in
|
|
32
|
-
* cross-filtering contexts.
|
|
33
|
-
* @returns {SelectionClause} The generated selection clause.
|
|
34
|
-
*/
|
|
35
|
-
export function clausePoints(fields: import("@uwdata/mosaic-sql").ExprValue[], value: any[][] | null | undefined, { source, clients }: {
|
|
36
|
-
source: any;
|
|
37
|
-
clients?: Set<MosaicClient>;
|
|
38
|
-
}): SelectionClause;
|
|
39
|
-
/**
|
|
40
|
-
* Generate a selection clause for a selected 1D interval.
|
|
41
|
-
* @param {import('@uwdata/mosaic-sql').ExprValue} field The table column or expression to select.
|
|
42
|
-
* @param {Extent | null | undefined} value The selected interval as a [lo, hi] array.
|
|
43
|
-
* @param {object} options Additional clause properties.
|
|
44
|
-
* @param {*} options.source The source component generating this clause.
|
|
45
|
-
* @param {Set<MosaicClient>} [options.clients] The Mosaic clients associated
|
|
46
|
-
* with this clause. These clients are not filtered by this clause in
|
|
47
|
-
* cross-filtering contexts.
|
|
48
|
-
* @param {Scale} [options.scale] The scale mapping descriptor.
|
|
49
|
-
* @param {BinMethod} [options.bin] A binning method hint.
|
|
50
|
-
* @param {number} [options.pixelSize=1] The interactive pixel size.
|
|
51
|
-
* @returns {SelectionClause} The generated selection clause.
|
|
52
|
-
*/
|
|
53
|
-
export function clauseInterval(field: import("@uwdata/mosaic-sql").ExprValue, value: Extent | null | undefined, { source, clients, bin, scale, pixelSize }: {
|
|
54
|
-
source: any;
|
|
55
|
-
clients?: Set<MosaicClient>;
|
|
56
|
-
scale?: Scale;
|
|
57
|
-
bin?: BinMethod;
|
|
58
|
-
pixelSize?: number;
|
|
59
|
-
}): SelectionClause;
|
|
60
|
-
/**
|
|
61
|
-
* Generate a selection clause for multiple selected intervals.
|
|
62
|
-
* @param {import('@uwdata/mosaic-sql').ExprValue[]} fields The table columns or expressions to select.
|
|
63
|
-
* @param {Extent[] | null | undefined} value The selected intervals, as an array of extents.
|
|
64
|
-
* @param {object} options Additional clause properties.
|
|
65
|
-
* @param {*} options.source The source component generating this clause.
|
|
66
|
-
* @param {Set<MosaicClient>} [options.clients] The Mosaic clients associated
|
|
67
|
-
* with this clause. These clients are not filtered by this clause in
|
|
68
|
-
* cross-filtering contexts.
|
|
69
|
-
* @param {Scale[]} [options.scales] The scale mapping descriptors,
|
|
70
|
-
* in an order matching the given *fields* and *value* extents.
|
|
71
|
-
* @param {BinMethod} [options.bin] A binning method hint.
|
|
72
|
-
* @param {number} [options.pixelSize=1] The interactive pixel size.
|
|
73
|
-
* @returns {SelectionClause} The generated selection clause.
|
|
74
|
-
*/
|
|
75
|
-
export function clauseIntervals(fields: import("@uwdata/mosaic-sql").ExprValue[], value: Extent[] | null | undefined, { source, clients, bin, scales, pixelSize }: {
|
|
76
|
-
source: any;
|
|
77
|
-
clients?: Set<MosaicClient>;
|
|
78
|
-
scales?: Scale[];
|
|
79
|
-
bin?: BinMethod;
|
|
80
|
-
pixelSize?: number;
|
|
81
|
-
}): SelectionClause;
|
|
82
|
-
/**
|
|
83
|
-
* Generate a selection clause for text search matching.
|
|
84
|
-
* @param {import('@uwdata/mosaic-sql').ExprValue} field The table column or expression to select.
|
|
85
|
-
* @param {string | null | undefined} value The selected text search query string.
|
|
86
|
-
* @param {object} options Additional clause properties.
|
|
87
|
-
* @param {*} options.source The source component generating this clause.
|
|
88
|
-
* @param {Set<MosaicClient>} [options.clients] The Mosaic clients associated
|
|
89
|
-
* with this clause. These clients are not filtered by this clause in
|
|
90
|
-
* cross-filtering contexts.
|
|
91
|
-
* @param {MatchMethod} [options.method] The
|
|
92
|
-
* text matching method to use. Defaults to `'contains'`.
|
|
93
|
-
* @returns {SelectionClause} The generated selection clause.
|
|
94
|
-
*/
|
|
95
|
-
export function clauseMatch(field: import("@uwdata/mosaic-sql").ExprValue, value: string | null | undefined, { source, clients, method }: {
|
|
96
|
-
source: any;
|
|
97
|
-
clients?: Set<MosaicClient>;
|
|
98
|
-
method?: MatchMethod;
|
|
99
|
-
}): SelectionClause;
|
|
100
|
-
export type SelectionClause = import("./util/selection-types.js").SelectionClause;
|
|
101
|
-
export type Scale = import("./util/selection-types.js").Scale;
|
|
102
|
-
export type Extent = import("./util/selection-types.js").Extent;
|
|
103
|
-
export type MatchMethod = import("./util/selection-types.js").MatchMethod;
|
|
104
|
-
export type BinMethod = import("./util/selection-types.js").BinMethod;
|
|
105
|
-
import type { MosaicClient } from './MosaicClient.js';
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import type { Table } from '@uwdata/flechette';
|
|
2
|
-
export interface QueryRequest {
|
|
3
|
-
/** The query type. */
|
|
4
|
-
type?: string;
|
|
5
|
-
/** A SQL query string. */
|
|
6
|
-
sql: string;
|
|
7
|
-
}
|
|
8
|
-
export interface ArrowQueryRequest extends QueryRequest {
|
|
9
|
-
/** The query type. */
|
|
10
|
-
type?: 'arrow';
|
|
11
|
-
}
|
|
12
|
-
export interface ExecQueryRequest extends QueryRequest {
|
|
13
|
-
/** The query type. */
|
|
14
|
-
type: 'exec';
|
|
15
|
-
}
|
|
16
|
-
export interface JSONQueryRequest extends QueryRequest {
|
|
17
|
-
/** The query type. */
|
|
18
|
-
type: 'json';
|
|
19
|
-
}
|
|
20
|
-
export interface Connector {
|
|
21
|
-
/** Issue a query and return the result. */
|
|
22
|
-
query(query: ArrowQueryRequest): Promise<Table>;
|
|
23
|
-
query(query: ExecQueryRequest): Promise<void>;
|
|
24
|
-
query(query: JSONQueryRequest): Promise<Record<string, any>[]>;
|
|
25
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Connect to a DuckDB server over an HTTP REST interface.
|
|
3
|
-
* @param {object} [options] Connector options.
|
|
4
|
-
* @param {string} [options.uri] The URI for the DuckDB REST server.
|
|
5
|
-
* @param {ExtractionOptions} [options.ipc] Arrow IPC extraction options.
|
|
6
|
-
* @returns {Connector} A connector instance.
|
|
7
|
-
*/
|
|
8
|
-
export function restConnector({ uri, ipc, }?: {
|
|
9
|
-
uri?: string;
|
|
10
|
-
ipc?: ExtractionOptions;
|
|
11
|
-
}): Connector;
|
|
12
|
-
import type { ExtractionOptions } from '@uwdata/flechette';
|
|
13
|
-
import type { Connector } from './Connector.js';
|
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Connect to a DuckDB server over a WebSocket interface.
|
|
3
|
-
* @param {object} [options] Connector options.
|
|
4
|
-
* @param {string} [options.uri] The URI for the DuckDB REST server.
|
|
5
|
-
* @param {ExtractionOptions} [options.ipc] Arrow IPC extraction options.
|
|
6
|
-
* @returns {SocketConnector} A connector instance.
|
|
7
|
-
*/
|
|
8
|
-
export function socketConnector(options?: {
|
|
9
|
-
uri?: string;
|
|
10
|
-
ipc?: ExtractionOptions;
|
|
11
|
-
}): SocketConnector;
|
|
12
|
-
/**
|
|
13
|
-
* DuckDB socket connector.
|
|
14
|
-
* @implements {Connector}
|
|
15
|
-
*/
|
|
16
|
-
export class SocketConnector implements Connector {
|
|
17
|
-
/**
|
|
18
|
-
* @param {object} [options] Connector options.
|
|
19
|
-
* @param {string} [options.uri] The URI for the DuckDB REST server.
|
|
20
|
-
* @param {ExtractionOptions} [options.ipc] Arrow IPC extraction options.
|
|
21
|
-
*/
|
|
22
|
-
constructor({ uri, ipc, }?: {
|
|
23
|
-
uri?: string;
|
|
24
|
-
ipc?: ExtractionOptions;
|
|
25
|
-
});
|
|
26
|
-
_uri: string;
|
|
27
|
-
_queue: any[];
|
|
28
|
-
_connected: boolean;
|
|
29
|
-
_request: any;
|
|
30
|
-
_ws: WebSocket;
|
|
31
|
-
_events: {
|
|
32
|
-
open(): void;
|
|
33
|
-
close(): void;
|
|
34
|
-
error(event: any): void;
|
|
35
|
-
message({ data }: {
|
|
36
|
-
data: any;
|
|
37
|
-
}): void;
|
|
38
|
-
};
|
|
39
|
-
get connected(): boolean;
|
|
40
|
-
init(): void;
|
|
41
|
-
enqueue(query: any, resolve: any, reject: any): void;
|
|
42
|
-
next(): void;
|
|
43
|
-
/**
|
|
44
|
-
* @overload
|
|
45
|
-
* @param {ArrowQueryRequest} query
|
|
46
|
-
* @returns {Promise<Table>}
|
|
47
|
-
*
|
|
48
|
-
* @overload
|
|
49
|
-
* @param {ExecQueryRequest} query
|
|
50
|
-
* @returns {Promise<void>}
|
|
51
|
-
*
|
|
52
|
-
* @overload
|
|
53
|
-
* @param {JSONQueryRequest} query
|
|
54
|
-
* @returns {Promise<Record<string, any>[]>}
|
|
55
|
-
*
|
|
56
|
-
* @param {ArrowQueryRequest | ExecQueryRequest | JSONQueryRequest} query
|
|
57
|
-
* @returns {Promise<Table | void | Record<string, any>[]>}}
|
|
58
|
-
*/
|
|
59
|
-
query(query: ArrowQueryRequest): Promise<Table>;
|
|
60
|
-
/**
|
|
61
|
-
* @overload
|
|
62
|
-
* @param {ArrowQueryRequest} query
|
|
63
|
-
* @returns {Promise<Table>}
|
|
64
|
-
*
|
|
65
|
-
* @overload
|
|
66
|
-
* @param {ExecQueryRequest} query
|
|
67
|
-
* @returns {Promise<void>}
|
|
68
|
-
*
|
|
69
|
-
* @overload
|
|
70
|
-
* @param {JSONQueryRequest} query
|
|
71
|
-
* @returns {Promise<Record<string, any>[]>}
|
|
72
|
-
*
|
|
73
|
-
* @param {ArrowQueryRequest | ExecQueryRequest | JSONQueryRequest} query
|
|
74
|
-
* @returns {Promise<Table | void | Record<string, any>[]>}}
|
|
75
|
-
*/
|
|
76
|
-
query(query: ExecQueryRequest): Promise<void>;
|
|
77
|
-
/**
|
|
78
|
-
* @overload
|
|
79
|
-
* @param {ArrowQueryRequest} query
|
|
80
|
-
* @returns {Promise<Table>}
|
|
81
|
-
*
|
|
82
|
-
* @overload
|
|
83
|
-
* @param {ExecQueryRequest} query
|
|
84
|
-
* @returns {Promise<void>}
|
|
85
|
-
*
|
|
86
|
-
* @overload
|
|
87
|
-
* @param {JSONQueryRequest} query
|
|
88
|
-
* @returns {Promise<Record<string, any>[]>}
|
|
89
|
-
*
|
|
90
|
-
* @param {ArrowQueryRequest | ExecQueryRequest | JSONQueryRequest} query
|
|
91
|
-
* @returns {Promise<Table | void | Record<string, any>[]>}}
|
|
92
|
-
*/
|
|
93
|
-
query(query: JSONQueryRequest): Promise<Record<string, any>[]>;
|
|
94
|
-
}
|
|
95
|
-
import type { ExtractionOptions } from '@uwdata/flechette';
|
|
96
|
-
import type { Connector } from './Connector.js';
|
|
97
|
-
import type { ArrowQueryRequest } from './Connector.js';
|
|
98
|
-
import type { Table } from '@uwdata/flechette';
|
|
99
|
-
import type { ExecQueryRequest } from './Connector.js';
|
|
100
|
-
import type { JSONQueryRequest } from './Connector.js';
|
|
@@ -1,135 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @typedef {object} DuckDBWASMOptions
|
|
3
|
-
* @property {boolean} [log] Flag to enable logging.
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* @typedef {object} DuckDBWASMConnectorOptions
|
|
7
|
-
* @property {boolean} [log] Flag to enable logging.
|
|
8
|
-
* @property {ExtractionOptions} [ipc]
|
|
9
|
-
* Arrow IPC extraction options.
|
|
10
|
-
* @property {duckdb.AsyncDuckDB} [duckdb]
|
|
11
|
-
* Optional pre-existing DuckDB-WASM instance.
|
|
12
|
-
* @property {duckdb.AsyncDuckDBConnection} [connection]
|
|
13
|
-
* Optional pre-existing DuckDB-WASM connection.
|
|
14
|
-
*/
|
|
15
|
-
/**
|
|
16
|
-
* Connect to a DuckDB-WASM instance.
|
|
17
|
-
* @param {DuckDBWASMConnectorOptions} [options] Connector options.
|
|
18
|
-
* @returns {DuckDBWASMConnector} A connector instance.
|
|
19
|
-
*/
|
|
20
|
-
export function wasmConnector(options?: DuckDBWASMConnectorOptions): DuckDBWASMConnector;
|
|
21
|
-
/**
|
|
22
|
-
* DuckDB-WASM connector.
|
|
23
|
-
* @implements {Connector}
|
|
24
|
-
*/
|
|
25
|
-
export class DuckDBWASMConnector implements Connector {
|
|
26
|
-
/**
|
|
27
|
-
* Create a new DuckDB-WASM connector instance.
|
|
28
|
-
* @param {DuckDBWASMConnectorOptions} [options]
|
|
29
|
-
*/
|
|
30
|
-
constructor(options?: DuckDBWASMConnectorOptions);
|
|
31
|
-
/** @type {ExtractionOptions} */
|
|
32
|
-
_ipc: ExtractionOptions;
|
|
33
|
-
/** @type {DuckDBWASMOptions} */
|
|
34
|
-
_options: DuckDBWASMOptions;
|
|
35
|
-
/** @type {duckdb.AsyncDuckDB} */
|
|
36
|
-
_db: duckdb.AsyncDuckDB;
|
|
37
|
-
/** @type {duckdb.AsyncDuckDBConnection} */
|
|
38
|
-
_con: duckdb.AsyncDuckDBConnection;
|
|
39
|
-
/** @type {Promise<unknown>} */
|
|
40
|
-
_loadPromise: Promise<unknown>;
|
|
41
|
-
/**
|
|
42
|
-
* Get the backing DuckDB-WASM instance.
|
|
43
|
-
* Lazily initializes DuckDB-WASM if not already loaded.
|
|
44
|
-
* @returns {Promise<duckdb.AsyncDuckDB>} The DuckDB-WASM instance.
|
|
45
|
-
*/
|
|
46
|
-
getDuckDB(): Promise<duckdb.AsyncDuckDB>;
|
|
47
|
-
/**
|
|
48
|
-
* Get the backing DuckDB-WASM connection.
|
|
49
|
-
* Lazily initializes DuckDB-WASM if not already loaded.
|
|
50
|
-
* @returns {Promise<duckdb.AsyncDuckDBConnection>} The DuckDB-WASM connection.
|
|
51
|
-
*/
|
|
52
|
-
getConnection(): Promise<duckdb.AsyncDuckDBConnection>;
|
|
53
|
-
/**
|
|
54
|
-
* @overload
|
|
55
|
-
* @param {ArrowQueryRequest} query
|
|
56
|
-
* @returns {Promise<Table>}
|
|
57
|
-
*
|
|
58
|
-
* @overload
|
|
59
|
-
* @param {ExecQueryRequest} query
|
|
60
|
-
* @returns {Promise<void>}
|
|
61
|
-
*
|
|
62
|
-
* @overload
|
|
63
|
-
* @param {JSONQueryRequest} query
|
|
64
|
-
* @returns {Promise<Record<string, any>[]>}
|
|
65
|
-
*
|
|
66
|
-
* @param {ArrowQueryRequest | ExecQueryRequest | JSONQueryRequest} query
|
|
67
|
-
* @returns {Promise<Table | void | Record<string, any>[]>}}
|
|
68
|
-
*/
|
|
69
|
-
query(query: ArrowQueryRequest): Promise<Table>;
|
|
70
|
-
/**
|
|
71
|
-
* @overload
|
|
72
|
-
* @param {ArrowQueryRequest} query
|
|
73
|
-
* @returns {Promise<Table>}
|
|
74
|
-
*
|
|
75
|
-
* @overload
|
|
76
|
-
* @param {ExecQueryRequest} query
|
|
77
|
-
* @returns {Promise<void>}
|
|
78
|
-
*
|
|
79
|
-
* @overload
|
|
80
|
-
* @param {JSONQueryRequest} query
|
|
81
|
-
* @returns {Promise<Record<string, any>[]>}
|
|
82
|
-
*
|
|
83
|
-
* @param {ArrowQueryRequest | ExecQueryRequest | JSONQueryRequest} query
|
|
84
|
-
* @returns {Promise<Table | void | Record<string, any>[]>}}
|
|
85
|
-
*/
|
|
86
|
-
query(query: ExecQueryRequest): Promise<void>;
|
|
87
|
-
/**
|
|
88
|
-
* @overload
|
|
89
|
-
* @param {ArrowQueryRequest} query
|
|
90
|
-
* @returns {Promise<Table>}
|
|
91
|
-
*
|
|
92
|
-
* @overload
|
|
93
|
-
* @param {ExecQueryRequest} query
|
|
94
|
-
* @returns {Promise<void>}
|
|
95
|
-
*
|
|
96
|
-
* @overload
|
|
97
|
-
* @param {JSONQueryRequest} query
|
|
98
|
-
* @returns {Promise<Record<string, any>[]>}
|
|
99
|
-
*
|
|
100
|
-
* @param {ArrowQueryRequest | ExecQueryRequest | JSONQueryRequest} query
|
|
101
|
-
* @returns {Promise<Table | void | Record<string, any>[]>}}
|
|
102
|
-
*/
|
|
103
|
-
query(query: JSONQueryRequest): Promise<Record<string, any>[]>;
|
|
104
|
-
}
|
|
105
|
-
export type DuckDBWASMOptions = {
|
|
106
|
-
/**
|
|
107
|
-
* Flag to enable logging.
|
|
108
|
-
*/
|
|
109
|
-
log?: boolean;
|
|
110
|
-
};
|
|
111
|
-
export type DuckDBWASMConnectorOptions = {
|
|
112
|
-
/**
|
|
113
|
-
* Flag to enable logging.
|
|
114
|
-
*/
|
|
115
|
-
log?: boolean;
|
|
116
|
-
/**
|
|
117
|
-
* Arrow IPC extraction options.
|
|
118
|
-
*/
|
|
119
|
-
ipc?: ExtractionOptions;
|
|
120
|
-
/**
|
|
121
|
-
* Optional pre-existing DuckDB-WASM instance.
|
|
122
|
-
*/
|
|
123
|
-
duckdb?: duckdb.AsyncDuckDB;
|
|
124
|
-
/**
|
|
125
|
-
* Optional pre-existing DuckDB-WASM connection.
|
|
126
|
-
*/
|
|
127
|
-
connection?: duckdb.AsyncDuckDBConnection;
|
|
128
|
-
};
|
|
129
|
-
import type { Connector } from './Connector.js';
|
|
130
|
-
import type { ExtractionOptions } from '@uwdata/flechette';
|
|
131
|
-
import * as duckdb from '@duckdb/duckdb-wasm';
|
|
132
|
-
import type { ArrowQueryRequest } from './Connector.js';
|
|
133
|
-
import type { Table } from '@uwdata/flechette';
|
|
134
|
-
import type { ExecQueryRequest } from './Connector.js';
|
|
135
|
-
import type { JSONQueryRequest } from './Connector.js';
|
package/dist/types/index.d.ts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
export { MosaicClient } from "./MosaicClient.js";
|
|
2
|
-
export { makeClient } from "./make-client.js";
|
|
3
|
-
export { Priority } from "./QueryManager.js";
|
|
4
|
-
export { restConnector } from "./connectors/rest.js";
|
|
5
|
-
export { socketConnector } from "./connectors/socket.js";
|
|
6
|
-
export { wasmConnector } from "./connectors/wasm.js";
|
|
7
|
-
export { decodeIPC } from "./util/decode-ipc.js";
|
|
8
|
-
export { distinct } from "./util/distinct.js";
|
|
9
|
-
export { isArrowTable } from "./util/is-arrow-table.js";
|
|
10
|
-
export { synchronizer } from "./util/synchronizer.js";
|
|
11
|
-
export { throttle } from "./util/throttle.js";
|
|
12
|
-
export { toDataColumns } from "./util/to-data-columns.js";
|
|
13
|
-
export { queryFieldInfo } from "./util/field-info.js";
|
|
14
|
-
export { jsType } from "./util/js-type.js";
|
|
15
|
-
export { isActivatable } from "./util/is-activatable.js";
|
|
16
|
-
export { Coordinator, coordinator } from "./Coordinator.js";
|
|
17
|
-
export { Selection, isSelection } from "./Selection.js";
|
|
18
|
-
export { Param, isParam } from "./Param.js";
|
|
19
|
-
export { clauseInterval, clauseIntervals, clausePoint, clausePoints, clauseMatch } from "./SelectionClause.js";
|