@akohn/dashql 0.0.19-dev.299.g3adbd8a4b → 0.0.19-dev.368.g7091b292b
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/README.md +1 -2
- package/dist/core/api.d.ts +25 -18
- package/dist/core/api.js +45 -46
- package/dist/core/connection.d.ts +1 -1
- package/dist/core/index.d.ts +0 -4
- package/dist/core/index.js +1 -4
- package/dist/core/runtime.d.ts +1 -1
- package/dist/core/workbook.d.ts +1 -1
- package/dist/platform/compute/arrow_formatter.d.ts +3 -1
- package/dist/platform/compute/arrow_formatter.js +23 -20
- package/dist/platform/compute/computation_types.d.ts +7 -12
- package/dist/platform/compute/computation_types.js +6 -3
- package/dist/platform/compute/query_result_search_sql.d.ts +0 -7
- package/dist/platform/compute/query_result_search_sql.js +1 -19
- package/dist/platform/connections/connection_params.d.ts +5 -6
- package/dist/platform/connections/connection_params.js +14 -25
- package/dist/platform/connections/connection_state.d.ts +1 -1
- package/dist/platform/connections/connector_configs.d.ts +2 -3
- package/dist/platform/connections/connector_info.d.ts +4 -14
- package/dist/platform/connections/connector_info.js +1 -25
- package/dist/platform/connections/embedded_database_channel.d.ts +3 -3
- package/dist/platform/connections/embedded_database_channel.js +12 -6
- package/dist/platform/connections/hyper/hyper_error_info.d.ts +0 -15
- package/dist/platform/connections/hyper/hyper_error_info.js +1 -18
- package/dist/platform/connections/query_execution.js +9 -7
- package/dist/platform/connections/query_execution_args.d.ts +2 -2
- package/dist/platform/http_client.d.ts +1 -1
- package/dist/platform/logger/logger.d.ts +3 -3
- package/dist/platform/query/query_execution_state.d.ts +11 -38
- package/dist/platform/query/query_execution_state.js +6 -1
- package/dist/platform/query/query_progress.d.ts +0 -14
- package/dist/platform/query/query_result_cache.d.ts +2 -2
- package/dist/platform/storage/composite_storage_backend.d.ts +64 -0
- package/dist/platform/storage/composite_storage_backend.js +321 -0
- package/dist/platform/storage/native_storage_backend.d.ts +1 -1
- package/dist/platform/storage/native_storage_backend.js +1 -1
- package/dist/platform/storage/opfs_query_result_cache.d.ts +0 -2
- package/dist/platform/storage/opfs_query_result_cache.js +3 -5
- package/dist/platform/storage/opfs_storage_backend.d.ts +67 -0
- package/dist/platform/storage/opfs_storage_backend.js +494 -0
- package/dist/platform/storage/workbook_locator.d.ts +7 -0
- package/dist/platform/storage/workbook_locator.js +14 -0
- package/dist/platform/storage/workbook_tables.d.ts +1 -4
- package/dist/platform/storage/workbook_tables.js +3 -17
- package/dist/platform/storage/workbook_transfer.d.ts +9 -0
- package/dist/platform/storage/workbook_transfer.js +84 -0
- package/dist/platform/storage/workbook_tree.d.ts +30 -9
- package/dist/platform/storage/workbook_tree.js +17 -96
- package/dist/platform/utils/base64.js +4 -4
- package/dist/platform/web_http_client.d.ts +1 -4
- package/dist/platform/web_http_client.js +0 -5
- package/dist/platform/workbook/attachment_mounts.d.ts +12 -4
- package/dist/platform/workbook/attachment_mounts.js +69 -60
- package/dist/platform/workbook/run_events.js +1 -1
- package/dist/platform/workbook/script_compilation.d.ts +0 -1
- package/dist/platform/workbook/script_compilation.js +1 -14
- package/dist/platform/workbook/script_reference_check.js +7 -6
- package/dist/platform/workbook/script_types.d.ts +1 -1
- package/dist/platform/workbook/script_types.js +1 -10
- package/dist/platform/workbook/workbook_execution.d.ts +0 -2
- package/dist/platform/workbook/workbook_execution.js +1 -4
- package/dist/platform/workbook/workbook_inputs.d.ts +7 -7
- package/dist/platform/workbook/workbook_inputs.js +4 -4
- package/dist/platform/workbook/workbook_scripts.d.ts +2 -2
- package/dist/runtime/compute_platform.js +2 -2
- package/dist/runtime/node/node_platform.js +1 -1
- package/dist/runtime/platform_requests.js +1 -1
- package/dist/runtime/query/query_channels.d.ts +0 -2
- package/dist/runtime/query/query_channels.js +36 -55
- package/dist/runtime/run_mounts.d.ts +2 -1
- package/dist/runtime/run_mounts.js +4 -5
- package/dist/runtime/runtime.d.ts +3 -0
- package/dist/runtime/runtime.js +10 -6
- package/dist/runtime/runtime_storage.d.ts +2 -5
- package/dist/runtime/runtime_storage.js +4 -13
- package/dist/runtime/workbook_projection.js +2 -2
- package/dist/runtime/workbook_run_report.d.ts +3 -6
- package/dist/runtime/workbook_run_report.js +33 -47
- package/dist/wasm/dashql_core.d.ts +2206 -1922
- package/dist/wasm/dashql_core.js +428 -223
- package/dist/wasm/dashql_core.wasm +0 -0
- package/dist/wasm/dashql_dataflow.wasm +0 -0
- package/package.json +1 -1
- package/dist/core/format.d.ts +0 -4
- package/dist/core/format.js +0 -23
- package/dist/core/lookup.d.ts +0 -10
- package/dist/core/lookup.js +0 -129
- package/dist/core/tokens.d.ts +0 -9
- package/dist/core/tokens.js +0 -78
- package/dist/core/variant.d.ts +0 -4
- package/dist/core/variant.js +0 -0
- package/dist/platform/connections/hyper/local_cloud.d.ts +0 -15
- package/dist/platform/connections/hyper/local_cloud.js +0 -14
- package/dist/platform/connections/query_channel.d.ts +0 -3
- package/dist/platform/connections/query_channel.js +0 -11
- package/dist/platform/hyper_link_target.d.ts +0 -8
- package/dist/platform/hyper_link_target.js +0 -35
- package/dist/platform/sql/sql_format.d.ts +0 -9
- package/dist/platform/sql/sql_format.js +0 -40
- package/dist/platform/sql/sql_lint.d.ts +0 -27
- package/dist/platform/sql/sql_lint.js +0 -69
- package/dist/platform/sql/sql_report.d.ts +0 -18
- package/dist/platform/sql/sql_report.js +0 -80
- package/dist/platform/storage/storage_versions.d.ts +0 -3
- package/dist/platform/storage/storage_versions.js +0 -13
- package/dist/platform/utils/async_consumer.d.ts +0 -14
- package/dist/platform/utils/async_consumer.js +0 -24
- package/dist/platform/workbook/attachment_mirror.d.ts +0 -2
- package/dist/platform/workbook/attachment_mirror.js +0 -25
package/README.md
CHANGED
|
@@ -19,11 +19,10 @@ try {
|
|
|
19
19
|
}
|
|
20
20
|
```
|
|
21
21
|
|
|
22
|
-
The generated
|
|
22
|
+
The generated FlatBuffers are also available directly:
|
|
23
23
|
|
|
24
24
|
```ts
|
|
25
25
|
import * as buffers from '@akohn/dashql/buffers';
|
|
26
|
-
import type { VariantKind } from '@akohn/dashql';
|
|
27
26
|
```
|
|
28
27
|
|
|
29
28
|
Native objects (catalogs, scripts, sessions, ...) live in Wasm memory and
|
package/dist/core/api.d.ts
CHANGED
|
@@ -4,13 +4,7 @@ import * as glue from '../wasm/dashql_core.js';
|
|
|
4
4
|
import type { BatchRequest, BatchResult } from './batch.js';
|
|
5
5
|
import type { ScriptAnnotation } from './comment_tags.js';
|
|
6
6
|
import { DashQLQueryProgressFollower } from './query_history.js';
|
|
7
|
-
export
|
|
8
|
-
shell: 'Shell';
|
|
9
|
-
}
|
|
10
|
-
export type DashQLFeature = keyof DashQLFeatureClasses;
|
|
11
|
-
type FeatureClass = DashQLFeatureClasses[DashQLFeature];
|
|
12
|
-
export type DashQLBindings = DashQLCoreBindings & Partial<Pick<typeof glue, Extract<FeatureClass, keyof typeof glue>>>;
|
|
13
|
-
type DashQLCoreBindings = Pick<typeof glue, 'Catalog' | 'Script' | 'ScriptBatch' | 'ScriptSession' | 'QueryProfile' | 'SessionPlanRequest' | 'TableParameters' | 'planSession' | 'checkScriptReferences' | 'deriveSessionDataflow' | 'collectSessionInputs' | 'inputLiteral' | 'textChange' | 'quoteIdentifier' | 'quoteColumnName' | 'processBatch' | 'touchedRelations' | 'installPanicHook' | 'QueryProgressFollower' | 'replayQueryProgress' | 'Runtime'>;
|
|
7
|
+
export type DashQLBindings = Pick<typeof glue, 'Catalog' | 'Script' | 'ScriptBatch' | 'ScriptSession' | 'QueryProfile' | 'SessionPlanRequest' | 'TableParameters' | 'collectSessionInputs' | 'inputLiteral' | 'textChange' | 'quoteIdentifier' | 'quoteColumnName' | 'processBatch' | 'touchedRelations' | 'installPanicHook' | 'QueryProgressFollower' | 'replayQueryProgress' | 'Runtime' | 'Shell'>;
|
|
14
8
|
export type { Shell, ShellCompletionCandidate, ShellOperation, ShellPromptResult, ShellTerminalResult } from '../wasm/dashql_core.js';
|
|
15
9
|
export interface DataflowPlacement {
|
|
16
10
|
position?: {
|
|
@@ -80,8 +74,6 @@ export declare class DashQL {
|
|
|
80
74
|
registeredMemory: Set<WeakRef<Ptr<symbol>>>;
|
|
81
75
|
registeredMemoryRefs: WeakMap<Ptr<symbol>, WeakRef<Ptr<symbol>>>;
|
|
82
76
|
registeredMemoryCleanup: FinalizationRegistry<WeakRef<Ptr<symbol>>>;
|
|
83
|
-
hasFeature(feature: DashQLFeature): boolean;
|
|
84
|
-
feature<F extends DashQLFeature>(feature: F): NonNullable<DashQLBindings[DashQLFeatureClasses[F] & keyof DashQLBindings]>;
|
|
85
77
|
constructor(bindings: DashQLBindings);
|
|
86
78
|
static create(options?: DashQLModuleOptions): Promise<DashQL>;
|
|
87
79
|
static instantiated(): DashQL | null;
|
|
@@ -95,9 +87,6 @@ export declare class DashQL {
|
|
|
95
87
|
createScriptSession(catalog: DashQLCatalog, offsetUnit?: buffers.editor.EditorOffsetUnit): DashQLScriptSession;
|
|
96
88
|
createScriptSessionWithEntryId(catalog: DashQLCatalog, entryId: number, offsetUnit?: buffers.editor.EditorOffsetUnit): DashQLScriptSession;
|
|
97
89
|
private buildSessionPlanRequest;
|
|
98
|
-
planSession(request: SessionPlanRequest): FlatBufferPtr<buffers.execution.ExecutionGraph>;
|
|
99
|
-
checkScriptReferences(request: SessionPlanRequest): FlatBufferPtr<buffers.execution.ScriptReferenceCheck>;
|
|
100
|
-
deriveSessionDataflow(request: SessionPlanRequest): FlatBufferPtr<buffers.execution.SessionDataflow>;
|
|
101
90
|
collectSessionInputs(request: SessionPlanRequest): FlatBufferPtr<buffers.execution.SessionInputs>;
|
|
102
91
|
inputLiteral(value: string, type: string | null): string;
|
|
103
92
|
textChange(from: string, to: string): glue.WorkbookTextChange;
|
|
@@ -114,6 +103,24 @@ export declare class DashQL {
|
|
|
114
103
|
connectionParamsWithoutDraftRows<P extends object>(params: P): P;
|
|
115
104
|
connectionParamsLoginHint(params: object): string | null;
|
|
116
105
|
salesforceCatalogDatabase(): string;
|
|
106
|
+
runScripts(files: string[], names: string[]): glue.RunScriptSelection;
|
|
107
|
+
runConnectionLabel(params: object): string;
|
|
108
|
+
finishRunReport(input: glue.RunReportInput): glue.RunReportEnd;
|
|
109
|
+
localCloudParams<P extends object = Record<string, unknown>>(): P;
|
|
110
|
+
readWorkbookTree<T>(directory: object | null, stored?: boolean): T;
|
|
111
|
+
changeWorkbookTree<T>(stored: T, change: object): {
|
|
112
|
+
tree: T;
|
|
113
|
+
writes: {
|
|
114
|
+
path: string[];
|
|
115
|
+
text: string;
|
|
116
|
+
}[];
|
|
117
|
+
};
|
|
118
|
+
folderNameError(name: string, siblings: string[]): string | null;
|
|
119
|
+
freeFolderName(siblings: string[]): string;
|
|
120
|
+
validateDataFileName(name: string): void;
|
|
121
|
+
isAttachmentFileName(name: string): boolean;
|
|
122
|
+
newDataTableName(prefix: string): string;
|
|
123
|
+
isDataTableName(name: string): boolean;
|
|
117
124
|
hyperCloudDefaultDatabaseName(): string;
|
|
118
125
|
workbookTables(): glue.WorkbookTableSchema[];
|
|
119
126
|
storageVersions(): glue.StorageVersions;
|
|
@@ -130,13 +137,13 @@ export interface TableParametersScript {
|
|
|
130
137
|
session: DashQLScriptSession;
|
|
131
138
|
}
|
|
132
139
|
export declare class DashQLTableParameters {
|
|
133
|
-
readonly ptr: Ptr<typeof TABLE_PARAMETERS_TYPE>;
|
|
134
|
-
constructor(ptr: Ptr<typeof TABLE_PARAMETERS_TYPE>);
|
|
140
|
+
readonly ptr: Ptr<typeof TABLE_PARAMETERS_TYPE, glue.TableParameters>;
|
|
141
|
+
constructor(ptr: Ptr<typeof TABLE_PARAMETERS_TYPE, glue.TableParameters>);
|
|
135
142
|
destroy(): void;
|
|
136
143
|
publish(scripts: TableParametersScript[], attachments?: SessionPlanAttachment[]): number[];
|
|
137
144
|
attach(session: DashQLScriptSession): boolean;
|
|
138
145
|
}
|
|
139
|
-
export declare class Ptr<T extends symbol, O extends NativeObject =
|
|
146
|
+
export declare class Ptr<T extends symbol, O extends NativeObject = NativeObject> {
|
|
140
147
|
readonly type: T;
|
|
141
148
|
readonly api: DashQL;
|
|
142
149
|
private object;
|
|
@@ -146,7 +153,7 @@ export declare class Ptr<T extends symbol, O extends NativeObject = any> {
|
|
|
146
153
|
isNull(): boolean;
|
|
147
154
|
get(): O | null;
|
|
148
155
|
}
|
|
149
|
-
export declare class FlatBufferPtr<T extends FlatBufferObject<T, O>, O =
|
|
156
|
+
export declare class FlatBufferPtr<T extends FlatBufferObject<T, O>, O = ReturnType<T['unpack']>> {
|
|
150
157
|
readonly type: symbol;
|
|
151
158
|
readonly api: DashQL;
|
|
152
159
|
private readonly bytes;
|
|
@@ -155,7 +162,7 @@ export declare class FlatBufferPtr<T extends FlatBufferObject<T, O>, O = any> {
|
|
|
155
162
|
get dataLength(): number;
|
|
156
163
|
get data(): Uint8Array;
|
|
157
164
|
copy(): Uint8Array;
|
|
158
|
-
equals(other: FlatBufferPtr<T>): boolean;
|
|
165
|
+
equals(other: FlatBufferPtr<T, O>): boolean;
|
|
159
166
|
read(obj?: T | null): T;
|
|
160
167
|
unpack(obj?: T | null): O;
|
|
161
168
|
}
|
|
@@ -197,6 +204,7 @@ export declare abstract class DashQLScriptSessionReader<O extends NativeScriptSe
|
|
|
197
204
|
removeVisFlow(parseIfOutdated?: boolean): string;
|
|
198
205
|
rewriteParamTag(name: string, literal: string, parseIfOutdated?: boolean): string;
|
|
199
206
|
removeParamTag(name: string, parseIfOutdated?: boolean): string;
|
|
207
|
+
rewriteResultProjection(columns: string[], config: buffers.formatting.FormattingConfigT, parseIfOutdated?: boolean): string;
|
|
200
208
|
rewriteVisRenderer(statementId: number, kind: 'vegalite' | 'markdown' | 'table' | null, body?: string, parseIfOutdated?: boolean): string;
|
|
201
209
|
isFullyFormattable(config: buffers.formatting.FormattingConfigT, parseIfOutdated?: boolean): boolean;
|
|
202
210
|
computeDiff(target: DashQLScript): FlatBufferPtr<buffers.diff.ScriptDiff>;
|
|
@@ -323,7 +331,6 @@ export declare class DashQLQueryProfile {
|
|
|
323
331
|
startQuery(engine: buffers.profile.ProfileEngine): FlatBufferPtr<buffers.profile.QueryProfile, buffers.profile.QueryProfileT>;
|
|
324
332
|
applyEvents(events: string): FlatBufferPtr<buffers.profile.QueryProfileEvents>;
|
|
325
333
|
applyTrinoStatementStats(stats: string, time: number): FlatBufferPtr<buffers.profile.QueryProfileEvents>;
|
|
326
|
-
applyTrinoQueryInfo(info: string, time: number): FlatBufferPtr<buffers.profile.QueryProfileEvents>;
|
|
327
334
|
private readEvents;
|
|
328
335
|
snapshotEvents(): FlatBufferPtr<buffers.profile.QueryProfileEvents>;
|
|
329
336
|
}
|
package/dist/core/api.js
CHANGED
|
@@ -12,10 +12,7 @@ import { ScriptDiff } from "../gen/flatbuffers/dashql/buffers/diff/script-diff.j
|
|
|
12
12
|
import { EditorAnalysisVersionT } from "../gen/flatbuffers/dashql/buffers/editor/editor-analysis-version.js";
|
|
13
13
|
import { EditorOffsetUnit } from "../gen/flatbuffers/dashql/buffers/editor/editor-offset-unit.js";
|
|
14
14
|
import { EditorUpdate } from "../gen/flatbuffers/dashql/buffers/editor/editor-update.js";
|
|
15
|
-
import { ExecutionGraph } from "../gen/flatbuffers/dashql/buffers/execution/execution-graph.js";
|
|
16
15
|
import { ScriptCompilationResult } from "../gen/flatbuffers/dashql/buffers/execution/script-compilation-result.js";
|
|
17
|
-
import { ScriptReferenceCheck } from "../gen/flatbuffers/dashql/buffers/execution/script-reference-check.js";
|
|
18
|
-
import { SessionDataflow } from "../gen/flatbuffers/dashql/buffers/execution/session-dataflow.js";
|
|
19
16
|
import { SessionInputs } from "../gen/flatbuffers/dashql/buffers/execution/session-inputs.js";
|
|
20
17
|
import { ParsedScript } from "../gen/flatbuffers/dashql/buffers/parser/parsed-script.js";
|
|
21
18
|
import { QueryProfileEvents } from "../gen/flatbuffers/dashql/buffers/profile/query-profile-events.js";
|
|
@@ -29,7 +26,6 @@ import { decodeBatchResult, encodeBatchRequest } from "./batch.js";
|
|
|
29
26
|
import { DashQLQueryProgressFollower } from "./query_history.js";
|
|
30
27
|
import * as flatbuffers from "flatbuffers";
|
|
31
28
|
// dist/.stage/src/core/api.ts
|
|
32
|
-
var FEATURE_CLASSES = { shell: "Shell" };
|
|
33
29
|
var corePanicListeners = /* @__PURE__ */ new Set();
|
|
34
30
|
var corePanicMessage = null;
|
|
35
31
|
function onCorePanic(listener) {
|
|
@@ -60,9 +56,6 @@ var WORKBOOK_SCRIPT_SESSION_TYPE = Symbol("WORKBOOK_SCRIPT_SESSION_TYPE");
|
|
|
60
56
|
var EDITOR_UPDATE_TYPE = Symbol("EDITOR_UPDATE_TYPE");
|
|
61
57
|
var SCRIPT_DIFF_TYPE = Symbol("SCRIPT_DIFF_TYPE");
|
|
62
58
|
var SCRIPT_COMPILATION_TYPE = Symbol("SCRIPT_COMPILATION_TYPE");
|
|
63
|
-
var EXECUTION_GRAPH_TYPE = Symbol("EXECUTION_GRAPH_TYPE");
|
|
64
|
-
var SCRIPT_REFERENCE_CHECK_TYPE = Symbol("SCRIPT_REFERENCE_CHECK_TYPE");
|
|
65
|
-
var SESSION_DATAFLOW_TYPE = Symbol("SESSION_DATAFLOW_TYPE");
|
|
66
59
|
var SESSION_INPUTS_TYPE = Symbol("SESSION_INPUTS_TYPE");
|
|
67
60
|
var TABLE_PARAMETERS_TYPE = Symbol("TABLE_PARAMETERS_TYPE");
|
|
68
61
|
var FLAT_CATALOG_TYPE = Symbol("FLAT_CATALOG_TYPE");
|
|
@@ -93,15 +86,6 @@ var DashQL = class DashQL {
|
|
|
93
86
|
registeredMemory;
|
|
94
87
|
registeredMemoryRefs;
|
|
95
88
|
registeredMemoryCleanup;
|
|
96
|
-
hasFeature(feature) {
|
|
97
|
-
return FEATURE_CLASSES[feature] in this.bindings;
|
|
98
|
-
}
|
|
99
|
-
feature(feature) {
|
|
100
|
-
const name = FEATURE_CLASSES[feature];
|
|
101
|
-
const value = this.bindings[name];
|
|
102
|
-
if (value == null) throw new Error(`the core module was built without the feature ${feature}`);
|
|
103
|
-
return value;
|
|
104
|
-
}
|
|
105
89
|
constructor(bindings) {
|
|
106
90
|
this.encoder = new TextEncoder();
|
|
107
91
|
this.decoder = new TextDecoder();
|
|
@@ -149,7 +133,7 @@ var DashQL = class DashQL {
|
|
|
149
133
|
const entries = Array.from(this.registeredMemory);
|
|
150
134
|
for (let i = entries.length - 1; i >= 0; --i) try {
|
|
151
135
|
entries[i].deref()?.destroy();
|
|
152
|
-
} catch
|
|
136
|
+
} catch {}
|
|
153
137
|
this.registeredMemory = /* @__PURE__ */ new Set();
|
|
154
138
|
}
|
|
155
139
|
processBatch(request) {
|
|
@@ -193,30 +177,6 @@ var DashQL = class DashQL {
|
|
|
193
177
|
throw e;
|
|
194
178
|
}
|
|
195
179
|
}
|
|
196
|
-
planSession(request) {
|
|
197
|
-
const native = this.buildSessionPlanRequest(request);
|
|
198
|
-
try {
|
|
199
|
-
return new FlatBufferPtr(EXECUTION_GRAPH_TYPE, this, this.bindings.planSession(native), () => new ExecutionGraph());
|
|
200
|
-
} finally {
|
|
201
|
-
native.free();
|
|
202
|
-
}
|
|
203
|
-
}
|
|
204
|
-
checkScriptReferences(request) {
|
|
205
|
-
const native = this.buildSessionPlanRequest(request);
|
|
206
|
-
try {
|
|
207
|
-
return new FlatBufferPtr(SCRIPT_REFERENCE_CHECK_TYPE, this, this.bindings.checkScriptReferences(native), () => new ScriptReferenceCheck());
|
|
208
|
-
} finally {
|
|
209
|
-
native.free();
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
deriveSessionDataflow(request) {
|
|
213
|
-
const native = this.buildSessionPlanRequest(request);
|
|
214
|
-
try {
|
|
215
|
-
return new FlatBufferPtr(SESSION_DATAFLOW_TYPE, this, this.bindings.deriveSessionDataflow(native), () => new SessionDataflow());
|
|
216
|
-
} finally {
|
|
217
|
-
native.free();
|
|
218
|
-
}
|
|
219
|
-
}
|
|
220
180
|
collectSessionInputs(request) {
|
|
221
181
|
const native = this.buildSessionPlanRequest(request);
|
|
222
182
|
try {
|
|
@@ -273,6 +233,46 @@ var DashQL = class DashQL {
|
|
|
273
233
|
salesforceCatalogDatabase() {
|
|
274
234
|
return this.bindings.Runtime.salesforceCatalogDatabase();
|
|
275
235
|
}
|
|
236
|
+
runScripts(files, names) {
|
|
237
|
+
return this.bindings.Runtime.runScripts(files, names);
|
|
238
|
+
}
|
|
239
|
+
runConnectionLabel(params) {
|
|
240
|
+
return this.bindings.Runtime.runConnectionLabel(params);
|
|
241
|
+
}
|
|
242
|
+
finishRunReport(input) {
|
|
243
|
+
return this.bindings.Runtime.finishRunReport(input);
|
|
244
|
+
}
|
|
245
|
+
localCloudParams() {
|
|
246
|
+
return this.bindings.Runtime.localCloudParams();
|
|
247
|
+
}
|
|
248
|
+
readWorkbookTree(directory, stored = false) {
|
|
249
|
+
return this.bindings.Runtime.readWorkbookTree(directory, stored);
|
|
250
|
+
}
|
|
251
|
+
changeWorkbookTree(stored, change) {
|
|
252
|
+
const changed = this.bindings.Runtime.changeWorkbookTree(stored, change);
|
|
253
|
+
return {
|
|
254
|
+
tree: changed.tree,
|
|
255
|
+
writes: changed.writes
|
|
256
|
+
};
|
|
257
|
+
}
|
|
258
|
+
folderNameError(name, siblings) {
|
|
259
|
+
return this.bindings.Runtime.folderNameError(name, siblings) ?? null;
|
|
260
|
+
}
|
|
261
|
+
freeFolderName(siblings) {
|
|
262
|
+
return this.bindings.Runtime.freeFolderName(siblings);
|
|
263
|
+
}
|
|
264
|
+
validateDataFileName(name) {
|
|
265
|
+
this.bindings.Runtime.validateDataFileName(name);
|
|
266
|
+
}
|
|
267
|
+
isAttachmentFileName(name) {
|
|
268
|
+
return this.bindings.Runtime.isAttachmentFileName(name);
|
|
269
|
+
}
|
|
270
|
+
newDataTableName(prefix) {
|
|
271
|
+
return this.bindings.Runtime.newDataTableName(prefix, crypto.randomUUID());
|
|
272
|
+
}
|
|
273
|
+
isDataTableName(name) {
|
|
274
|
+
return this.bindings.Runtime.isDataTableName(name);
|
|
275
|
+
}
|
|
276
276
|
hyperCloudDefaultDatabaseName() {
|
|
277
277
|
return this.bindings.Runtime.hyperCloudDefaultDatabaseName();
|
|
278
278
|
}
|
|
@@ -474,6 +474,9 @@ var DashQLScriptSessionReader = class {
|
|
|
474
474
|
removeParamTag(name, parseIfOutdated = true) {
|
|
475
475
|
return this.ptr.assertNotNull().removeParamTag(name, parseIfOutdated);
|
|
476
476
|
}
|
|
477
|
+
rewriteResultProjection(columns, config, parseIfOutdated = true) {
|
|
478
|
+
return this.ptr.assertNotNull().rewriteResultProjection(columns, config.dialect, config.mode, config.maxWidth, config.indentationWidth, config.keywordCase, parseIfOutdated);
|
|
479
|
+
}
|
|
477
480
|
rewriteVisRenderer(statementId, kind, body = "", parseIfOutdated = true) {
|
|
478
481
|
return this.ptr.assertNotNull().rewriteVisRenderer(statementId, kind ?? "", body, parseIfOutdated);
|
|
479
482
|
}
|
|
@@ -616,7 +619,7 @@ var DashQLScript = class DashQLScript {
|
|
|
616
619
|
tryCompleteAtCursor(limit) {
|
|
617
620
|
try {
|
|
618
621
|
return this.completeAtCursor(limit);
|
|
619
|
-
} catch
|
|
622
|
+
} catch {
|
|
620
623
|
return null;
|
|
621
624
|
}
|
|
622
625
|
}
|
|
@@ -875,10 +878,6 @@ var DashQLQueryProfile = class {
|
|
|
875
878
|
const bytes = this.ptr.assertNotNull().applyTrinoStatementStats(this.ptr.api.encoder.encode(stats), time);
|
|
876
879
|
return this.readEvents(bytes);
|
|
877
880
|
}
|
|
878
|
-
applyTrinoQueryInfo(info, time) {
|
|
879
|
-
const bytes = this.ptr.assertNotNull().applyTrinoQueryInfo(this.ptr.api.encoder.encode(info), time);
|
|
880
|
-
return this.readEvents(bytes);
|
|
881
|
-
}
|
|
882
881
|
readEvents(bytes) {
|
|
883
882
|
if (this.buffer == null || this.buffer.read().structureVersion() !== this.ptr.assertNotNull().structureVersion()) this.pack();
|
|
884
883
|
return new FlatBufferPtr(QUERY_PROFILE_EVENTS_TYPE, this.ptr.api, bytes, () => new QueryProfileEvents());
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export type { ConnectionCatalogUpdates, ConnectionCatalogUpdateTask, ConnectionConnectorDetails, ConnectionDetailsView, ConnectionError, ConnectionListEntry, ConnectionListView, ConnectionNameDefaults, ConnectionRelationName, ConnectionSalesforceOAuthParams, ConnectionSalesforceOAuthState, ConnectionSaveView, ConnectionSecrets, ConnectionTableName, ConnectionTokenSummary, ConnectionTrinoOAuthState, ConnectionView, JsonParams, } from '../wasm/dashql_core.js';
|
|
1
|
+
export type { ConnectionCatalogUpdates, ConnectionCatalogUpdateTask, ConnectionCloudDatabase, ConnectionConnectorDetails, ConnectionDetailsView, ConnectionError, ConnectionLabel, ConnectionListEntry, ConnectionListView, ConnectionNameDefaults, ConnectionRelationName, ConnectionSalesforceOAuthParams, ConnectionSalesforceOAuthState, ConnectionSaveView, ConnectionSecrets, ConnectionTableName, ConnectionTokenSummary, ConnectionTrinoOAuthState, ConnectionView, HyperLinkBindingView, HyperLinkView, JsonParams, } from '../wasm/dashql_core.js';
|
|
2
2
|
export type { ConnectionCopyOutcome, ConnectionSaveOutcome } from '../wasm/dashql_core.js';
|
|
3
3
|
export { CatalogUpdateTaskStatus, CatalogUpdateVariant, ConnectionHealth, ConnectionStatus, ConnectorType } from '../wasm/dashql_core.js';
|
package/dist/core/index.d.ts
CHANGED
|
@@ -7,8 +7,4 @@ export * from './runtime.js';
|
|
|
7
7
|
export * from './flatbuffer_view.js';
|
|
8
8
|
export * from './dataflow.js';
|
|
9
9
|
export * from './batch.js';
|
|
10
|
-
export * from './tokens.js';
|
|
11
|
-
export * from './lookup.js';
|
|
12
|
-
export * from './format.js';
|
|
13
|
-
export type { VariantKind } from './variant.js';
|
|
14
10
|
export * from './comment_tags.js';
|
package/dist/core/index.js
CHANGED
|
@@ -8,8 +8,5 @@ import "./runtime.js";
|
|
|
8
8
|
import { FlatBufferCache, readFlatBuffer } from "./flatbuffer_view.js";
|
|
9
9
|
import { DashQLDataflow } from "./dataflow.js";
|
|
10
10
|
import { decodeBatchResult, encodeBatchRequest } from "./batch.js";
|
|
11
|
-
import { findClosestToken, findTokensAtTextSpan, findTokensInRange, getScannerTokenTypeName, resolveSymbolSpan } from "./tokens.js";
|
|
12
|
-
import { findCatalogDatabaseById, findCatalogSchemaById, findCatalogTableById, findScriptColumnRefsEqualRange, findScriptColumnRefsLowerBound, findScriptColumnRefsUpperBound, findScriptTableRefsEqualRange, findScriptTableRefsLowerBound, findScriptTableRefsUpperBound } from "./lookup.js";
|
|
13
|
-
import { formatQualifiedColumnName, formatQualifiedFunctionName, formatQualifiedTableName } from "./format.js";
|
|
14
11
|
import { COMMENT_TAG_END, COMMENT_TAG_PREFIX, annotationTag, annotationTagText, readCommentTags, readStatementCommentTags } from "./comment_tags.js";
|
|
15
|
-
export { COMMENT_TAG_END, COMMENT_TAG_PREFIX, CatalogUpdateTaskStatus, CatalogUpdateVariant, ConnectionHealth, ConnectionStatus, ConnectorType, ContextObjectChildID, DashQL, DashQLCatalog, DashQLDataflow, DashQLFlatCatalog, DashQLFlatCatalogReader, DashQLQueryProfile, DashQLQueryProgressFollower, DashQLScript, DashQLScriptSession, DashQLScriptSessionReader, DashQLTableParameters, DashQLWorkbookScriptSession, ExternalObjectID, FlatBufferCache, FlatBufferPtr, NULL_POINTER_EXCEPTION, ParserError, Ptr, QueryExecutionStatus, QueryType, TaskStatus, annotationTag, annotationTagText, buffers_exports as buffers, decodeBatchResult, encodeBatchRequest,
|
|
12
|
+
export { COMMENT_TAG_END, COMMENT_TAG_PREFIX, CatalogUpdateTaskStatus, CatalogUpdateVariant, ConnectionHealth, ConnectionStatus, ConnectorType, ContextObjectChildID, DashQL, DashQLCatalog, DashQLDataflow, DashQLFlatCatalog, DashQLFlatCatalogReader, DashQLQueryProfile, DashQLQueryProgressFollower, DashQLScript, DashQLScriptSession, DashQLScriptSessionReader, DashQLTableParameters, DashQLWorkbookScriptSession, ExternalObjectID, FlatBufferCache, FlatBufferPtr, NULL_POINTER_EXCEPTION, ParserError, Ptr, QueryExecutionStatus, QueryType, TaskStatus, annotationTag, annotationTagText, buffers_exports as buffers, decodeBatchResult, encodeBatchRequest, getCorePanic, onCorePanic, readCommentTags, readFlatBuffer, readStatementCommentTags, scriptDiffBuffer, takeKnownAnalysis };
|
package/dist/core/runtime.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export type { Runtime, RuntimePlatform, RuntimeSettings, RuntimeHandles, RuntimeTables, RuntimeHttp, RuntimeHttpRequest, RuntimeHttpResponse, RuntimeChannels, RuntimeChannelMessage, RuntimeChannelTarget, RuntimeChannelRequest, RuntimeChannelQuery, RuntimeOAuth, RuntimeOAuthFlowInfo, RuntimeResultCache, RuntimeCachedTable, RuntimeMounts, RuntimeMemoryFile, RuntimeStorage, RuntimeStorageRoot, RuntimeFolder, RuntimeFolderStamps, RuntimeFileStamp, RuntimeWorkbookFolder, StorageMigrationOutcome, StorageVersions, WorkbookTableSchema, WorkbookTableColumn, WorkbookTableColumnType, ExternalChangeView, StorageView, StorageCommand, StorageWriteOutcome, StorageWriteStatistics, StorageHoldReason, StorageHoldView, StorageKeyStatistics, FailedStorageWriteView, RestoreOutcome, RestoreProgress, RestoreProgressCounter, RestoredInvalidWorkbook, RestoreScriptFile, RuntimeArchives, RuntimeArchiveEntry, RuntimeImportFolder, AttachedFile, AttachedFileName, AttachFilesOutcome, ImportSource, ImportStep, ImportPreview, ImportConflict, ImportQuestion, ImportCandidate, ImportResultFiles, ImportChoice, ImportConflictChoice, ImportAnswers, ImportedResults, ImportOutcome, ExportFormat, ExportOptions, ExportOutcome, ExportedResults, ExportedTables, ConnectionLinkOptions, SetupOptions, SetupOutcome, SetupAuthentication, QueryArgs, QueryOptions, QueryCacheOptions, QueryTicket, QueryRunOutcome, QueryRunFailure, QueryRunFailureKind, QueryCallerEvent, SliceId, RuntimeViews, ViewKind, BusyView, ViewId, ViewOf, KnownKeys, Target, RuntimeAction, ActionOf, AppAction, ComputationAction, ConnectionAction, WorkbookAction, DispatchOutcome, ChangeSet, SliceChange, HandleEffect, ComputePlatform, ComputeCallContext, AnalyzeTableOptions, ComputationView, ComputationTasks, ComputationTrackedTask, ComputationTaskProgress, ComputationVersionValue, ComputationColumnGroup, ComputationValueColumn, ComputationStatsFields, ComputationScalarFilter, ComputationFilterOp, ComputationOrderBy, ComputationCrossFilter, ComputationTableAggregation, ComputationColumnAggregate, ComputationColumnSummary, ComputationSummaryAnalysis, ComputationBinBounds, ComputationFilteredAggregate, ComputationSearch, ComputationSearchKind, ComputationFilterTable, ComputationOrderingTable, ComputationDataSearchTable, } from '../wasm/dashql_core.js';
|
|
1
|
+
export type { Runtime, RuntimePlatform, RuntimeSettings, RuntimeHandles, RuntimeTables, RuntimeHttp, RuntimeHttpRequest, RuntimeHttpResponse, RuntimeChannels, RuntimeChannelMessage, RuntimeChannelTarget, RuntimeChannelRequest, EmbeddedHyperSession, RuntimeChannelQuery, RuntimeOAuth, RuntimeOAuthFlowInfo, RuntimeResultCache, RuntimeCachedTable, RuntimeMounts, RuntimeMemoryFile, RuntimeStorage, RuntimeStorageRoot, RuntimeFolder, RuntimeFolderStamps, RuntimeFileStamp, RuntimeWorkbookFolder, StorageMigrationOutcome, StorageVersions, WorkbookTableSchema, WorkbookTableColumn, WorkbookTableColumnType, ExternalChangeView, StorageView, StorageCommand, StorageWriteOutcome, StorageWriteStatistics, StorageHoldReason, StorageHoldView, StorageKeyStatistics, FailedStorageWriteView, RestoreOutcome, RestoreProgress, RestoreProgressCounter, RestoredInvalidWorkbook, RestoreScriptFile, RuntimeArchives, RuntimeArchiveEntry, RuntimeImportFolder, AttachedFile, AttachedFileName, AttachFilesOutcome, ImportSource, ImportStep, ImportPreview, ImportConflict, ImportQuestion, ImportCandidate, ImportResultFiles, ImportChoice, ImportConflictChoice, ImportAnswers, ImportedResults, ImportOutcome, ExportFormat, ExportOptions, ExportOutcome, ExportedResults, ExportedTables, ConnectionLinkOptions, SetupOptions, SetupOutcome, SetupAuthentication, QueryArgs, QueryOptions, QueryCacheOptions, QueryTicket, QueryRunOutcome, QueryRunFailure, QueryRunFailureKind, QueryCallerEvent, SliceId, RuntimeViews, ViewKind, BusyView, ViewId, ViewOf, KnownKeys, Target, RuntimeAction, ActionOf, AppAction, ComputationAction, ConnectionAction, WorkbookAction, DispatchOutcome, ChangeSet, SliceChange, HandleEffect, ComputePlatform, ComputeCallContext, AnalyzeTableOptions, ComputationView, ComputationTasks, ComputationTrackedTask, ComputationTaskProgress, ComputationVersionValue, ComputationColumnGroup, ComputationValueColumn, ComputationStatsFields, ComputationScalarFilter, ComputationFilterOp, ComputationOrderBy, ComputationCrossFilter, ComputationTableAggregation, ComputationColumnAggregate, ComputationColumnSummary, ComputationSummaryAnalysis, ComputationBinBounds, ComputationFilteredAggregate, ComputationSearch, ComputationSearchKind, ComputationFilterTable, ComputationOrderingTable, ComputationDataSearchTable, } from '../wasm/dashql_core.js';
|
|
2
2
|
export { TaskStatus } from '../wasm/dashql_core.js';
|
package/dist/core/workbook.d.ts
CHANGED
|
@@ -2,5 +2,5 @@ import * as buffers from './buffers.js';
|
|
|
2
2
|
import { DashQL, FlatBufferPtr } from './api.js';
|
|
3
3
|
import type { FlatBuffer } from '../wasm/dashql_core.js';
|
|
4
4
|
export type { EditorEventOutcome, StoredScriptView, WorkbookAttachmentView, WorkbookCloudLink, WorkbookConnectionCopy, WorkbookDataFile, WorkbookDerivedView, WorkbookExternalChanges, WorkbookListEntry, WorkbookListView, WorkbookPendingDiff, WorkbookScriptKeys, WorkbookScriptList, WorkbookScriptListEntry, WorkbookScriptCachedResult, WorkbookScriptStatistics, WorkbookScriptView, WorkbookScriptVisualization, WorkbookTextChange, WorkbookView, } from '../wasm/dashql_core.js';
|
|
5
|
-
export type { RunListener, RunOutcome, RunScriptOptions, RunWorkbookOptions, WorkbookRunFailure, WorkbookRunFailureKind, WorkbookRunKind, WorkbookRunPhase, WorkbookRunState, WorkbookRunView, WorkbookScriptRunEvent, } from '../wasm/dashql_core.js';
|
|
5
|
+
export type { ReportedNotRun, ReportedScript, ReportedScriptOutcome, RunListener, RunOutcome, RunReportEnd, RunReportInput, RunScriptOptions, RunScriptSelection, RunWorkbookOptions, WorkbookRunFailure, WorkbookRunFailureKind, WorkbookRunKind, WorkbookRunPhase, WorkbookRunState, WorkbookRunView, WorkbookScriptRunEvent, } from '../wasm/dashql_core.js';
|
|
6
6
|
export declare function scriptDiffBuffer(api: DashQL, bytes: FlatBuffer<buffers.diff.ScriptDiff>): FlatBufferPtr<buffers.diff.ScriptDiff>;
|
|
@@ -16,6 +16,7 @@ export interface ArrowColumnFormatter {
|
|
|
16
16
|
export interface ArrowValueFormatter {
|
|
17
17
|
format: (value: unknown) => string | null;
|
|
18
18
|
}
|
|
19
|
+
type ValueFormatter = (o: unknown) => null | string;
|
|
19
20
|
export declare function makeArrowValueFormatter(field: arrow.Field, logger?: LoggerLike): ArrowValueFormatter;
|
|
20
21
|
export declare class ArrowTextColumnFormatter implements ArrowColumnFormatter {
|
|
21
22
|
readonly logger: LoggerLike;
|
|
@@ -27,7 +28,7 @@ export declare class ArrowTextColumnFormatter implements ArrowColumnFormatter {
|
|
|
27
28
|
formattedRowCount: number;
|
|
28
29
|
formattedLengthMax: number;
|
|
29
30
|
formattedLengthSum: number;
|
|
30
|
-
formatter:
|
|
31
|
+
formatter: ValueFormatter;
|
|
31
32
|
constructor(logger: LoggerLike, columnId: number, schema: arrow.Schema, batches: arrow.RecordBatch[]);
|
|
32
33
|
getValue(batch: number, row: number): string | null;
|
|
33
34
|
getColumnName(): string;
|
|
@@ -41,3 +42,4 @@ export declare class ArrowTableFormatter {
|
|
|
41
42
|
getValue(row: number, column: number): (string | null);
|
|
42
43
|
}
|
|
43
44
|
export declare function dataTypeToString(t: arrow.DataType): string;
|
|
45
|
+
export {};
|
|
@@ -143,7 +143,7 @@ function formatStruct(value) {
|
|
|
143
143
|
}
|
|
144
144
|
return `{${entries.join(", ")}}`;
|
|
145
145
|
}
|
|
146
|
-
function formatInterval(value,
|
|
146
|
+
function formatInterval(value, _typeId) {
|
|
147
147
|
if (value == null) return "";
|
|
148
148
|
if (typeof value === "number") {
|
|
149
149
|
const years = Math.floor(value / 12);
|
|
@@ -194,6 +194,9 @@ function readRawInt64(column, row) {
|
|
|
194
194
|
}
|
|
195
195
|
return null;
|
|
196
196
|
}
|
|
197
|
+
function ofValues(format) {
|
|
198
|
+
return format;
|
|
199
|
+
}
|
|
197
200
|
function makeArrowValueFormatter(field, logger) {
|
|
198
201
|
let formatter = (_) => "";
|
|
199
202
|
switch (field.type.typeId) {
|
|
@@ -206,23 +209,23 @@ function makeArrowValueFormatter(field, logger) {
|
|
|
206
209
|
case arrow.Type.Float32:
|
|
207
210
|
case arrow.Type.Float64: {
|
|
208
211
|
const fmt = Intl.NumberFormat("en-US");
|
|
209
|
-
formatter = (v) => v == null ? null : fmt.format(v);
|
|
212
|
+
formatter = ofValues((v) => v == null ? null : fmt.format(v));
|
|
210
213
|
break;
|
|
211
214
|
}
|
|
212
215
|
case arrow.Type.Decimal: {
|
|
213
216
|
const decimalType = field.type;
|
|
214
|
-
formatter = (v) => {
|
|
217
|
+
formatter = ofValues((v) => {
|
|
215
218
|
const i = Int128.decodeLE(v);
|
|
216
219
|
return Decimal128.format(i, decimalType.scale);
|
|
217
|
-
};
|
|
220
|
+
});
|
|
218
221
|
break;
|
|
219
222
|
}
|
|
220
223
|
case arrow.Type.Utf8:
|
|
221
224
|
case arrow.Type.LargeUtf8:
|
|
222
|
-
formatter = (v) => v || null;
|
|
225
|
+
formatter = ofValues((v) => v || null);
|
|
223
226
|
break;
|
|
224
227
|
case arrow.Type.Bool:
|
|
225
|
-
formatter = (v) => v == null ? null : v ? "true" : "false";
|
|
228
|
+
formatter = ofValues((v) => v == null ? null : v ? "true" : "false");
|
|
226
229
|
break;
|
|
227
230
|
case arrow.Type.Null:
|
|
228
231
|
formatter = () => null;
|
|
@@ -230,7 +233,7 @@ function makeArrowValueFormatter(field, logger) {
|
|
|
230
233
|
case arrow.Type.Binary:
|
|
231
234
|
case arrow.Type.LargeBinary:
|
|
232
235
|
case arrow.Type.FixedSizeBinary:
|
|
233
|
-
formatter = (v) => v == null ? null : formatBinary(v);
|
|
236
|
+
formatter = ofValues((v) => v == null ? null : formatBinary(v));
|
|
234
237
|
break;
|
|
235
238
|
case arrow.Type.Time:
|
|
236
239
|
case arrow.Type.TimeSecond:
|
|
@@ -238,7 +241,7 @@ function makeArrowValueFormatter(field, logger) {
|
|
|
238
241
|
case arrow.Type.TimeMicrosecond:
|
|
239
242
|
case arrow.Type.TimeNanosecond: {
|
|
240
243
|
const timeType = field.type;
|
|
241
|
-
formatter = (v) => v == null ? null : formatTime(v, timeType.unit);
|
|
244
|
+
formatter = ofValues((v) => v == null ? null : formatTime(v, timeType.unit));
|
|
242
245
|
break;
|
|
243
246
|
}
|
|
244
247
|
case arrow.Type.Timestamp:
|
|
@@ -250,7 +253,7 @@ function makeArrowValueFormatter(field, logger) {
|
|
|
250
253
|
dateStyle: "short",
|
|
251
254
|
timeStyle: "medium"
|
|
252
255
|
});
|
|
253
|
-
formatter = (v) => v == null ? null : formatEpochMilliseconds(fmt, v);
|
|
256
|
+
formatter = ofValues((v) => v == null ? null : formatEpochMilliseconds(fmt, v));
|
|
254
257
|
break;
|
|
255
258
|
}
|
|
256
259
|
case arrow.Type.DateMillisecond:
|
|
@@ -262,7 +265,7 @@ function makeArrowValueFormatter(field, logger) {
|
|
|
262
265
|
month: "short",
|
|
263
266
|
year: "numeric"
|
|
264
267
|
});
|
|
265
|
-
formatter = (v) => v == null ? null : formatEpochMilliseconds(fmt, v);
|
|
268
|
+
formatter = ofValues((v) => v == null ? null : formatEpochMilliseconds(fmt, v));
|
|
266
269
|
break;
|
|
267
270
|
}
|
|
268
271
|
case arrow.Type.Duration:
|
|
@@ -271,40 +274,40 @@ function makeArrowValueFormatter(field, logger) {
|
|
|
271
274
|
case arrow.Type.DurationMicrosecond:
|
|
272
275
|
case arrow.Type.DurationNanosecond: {
|
|
273
276
|
const durationType = field.type;
|
|
274
|
-
formatter = (v) => {
|
|
277
|
+
formatter = ofValues((v) => {
|
|
275
278
|
if (v == null) return null;
|
|
276
279
|
return formatDuration(v, durationType.unit);
|
|
277
|
-
};
|
|
280
|
+
});
|
|
278
281
|
break;
|
|
279
282
|
}
|
|
280
283
|
case arrow.Type.List:
|
|
281
284
|
case arrow.Type.FixedSizeList:
|
|
282
|
-
formatter = (v) => {
|
|
285
|
+
formatter = ofValues((v) => {
|
|
283
286
|
if (v == null) return null;
|
|
284
287
|
return formatList(v);
|
|
285
|
-
};
|
|
288
|
+
});
|
|
286
289
|
break;
|
|
287
290
|
case arrow.Type.Struct:
|
|
288
|
-
formatter = (v) => {
|
|
291
|
+
formatter = ofValues((v) => {
|
|
289
292
|
if (v == null) return null;
|
|
290
293
|
return formatStruct(v);
|
|
291
|
-
};
|
|
294
|
+
});
|
|
292
295
|
break;
|
|
293
296
|
case arrow.Type.Map:
|
|
294
|
-
formatter = (v) => {
|
|
297
|
+
formatter = ofValues((v) => {
|
|
295
298
|
if (v == null) return null;
|
|
296
299
|
return formatStruct(v);
|
|
297
|
-
};
|
|
300
|
+
});
|
|
298
301
|
break;
|
|
299
302
|
case arrow.Type.Interval:
|
|
300
303
|
case arrow.Type.IntervalDayTime:
|
|
301
304
|
case arrow.Type.IntervalYearMonth:
|
|
302
305
|
case arrow.Type.IntervalMonthDayNano: {
|
|
303
306
|
const intervalType = field.type;
|
|
304
|
-
formatter = (v) => {
|
|
307
|
+
formatter = ofValues((v) => {
|
|
305
308
|
if (v == null) return null;
|
|
306
309
|
return formatInterval(v, intervalType.typeId);
|
|
307
|
-
};
|
|
310
|
+
});
|
|
308
311
|
break;
|
|
309
312
|
}
|
|
310
313
|
case arrow.Type.Union:
|
|
@@ -8,14 +8,7 @@ export declare const LIST_COLUMN = "LIST";
|
|
|
8
8
|
export declare const SKIPPED_COLUMN = "SKIPPED";
|
|
9
9
|
export declare const ROWNUMBER_COLUMN = "ROWNUMBER";
|
|
10
10
|
export { TaskStatus } from '../../core/index.js';
|
|
11
|
-
export
|
|
12
|
-
export type ColumnGroup = core.ComputationColumnGroup;
|
|
13
|
-
export type GridValueColumn = core.ComputationValueColumn;
|
|
14
|
-
export type OrderByConstraint = core.ComputationOrderBy;
|
|
15
|
-
export type ComputationStateVersion = core.ComputationVersionValue;
|
|
16
|
-
export type ResultSearchState = core.ComputationSearch;
|
|
17
|
-
export type TrackedTask = core.ComputationTrackedTask;
|
|
18
|
-
export interface SummaryColumn extends Omit<GridValueColumn, 'inputFieldType'> {
|
|
11
|
+
export interface SummaryColumn extends Omit<core.ComputationValueColumn, 'inputFieldType'> {
|
|
19
12
|
inputFieldType: arrow.DataType;
|
|
20
13
|
}
|
|
21
14
|
export interface TableAggregation {
|
|
@@ -72,7 +65,7 @@ export type ColumnAggregationVariant = {
|
|
|
72
65
|
value: null;
|
|
73
66
|
};
|
|
74
67
|
export type WithFilterEpoch<T> = T & {
|
|
75
|
-
filterVersion:
|
|
68
|
+
filterVersion: core.ComputationVersionValue;
|
|
76
69
|
dataSearchRequestId: number | null;
|
|
77
70
|
};
|
|
78
71
|
export type BinnedValuesTable<WidthType extends arrow.DataType = arrow.DataType, BoundType extends arrow.DataType = arrow.DataType> = arrow.Table<{
|
|
@@ -95,6 +88,8 @@ export interface ComputationSummaries {
|
|
|
95
88
|
export interface SummaryTables {
|
|
96
89
|
table(handle: number | null | undefined): arrow.Table | undefined;
|
|
97
90
|
}
|
|
98
|
-
export declare function resolveTableAggregation(view:
|
|
99
|
-
export
|
|
100
|
-
export declare function
|
|
91
|
+
export declare function resolveTableAggregation(view: Pick<core.ComputationView, 'tableAggregation'>, tables: SummaryTables, logger: LoggerLike): TableAggregation | null;
|
|
92
|
+
export type SummaryView = Pick<core.ComputationView, 'dataTable' | 'tableAggregation' | 'columnAggregates' | 'filteredColumnAggregates' | 'columnGroups'>;
|
|
93
|
+
export declare function resolveSummaries(view: SummaryView, tables: SummaryTables, logger: LoggerLike): ComputationSummaries;
|
|
94
|
+
export declare function resolveMatchingRows(view: core.ComputationView | null, tables: SummaryTables): Map<number, number[]> | null;
|
|
95
|
+
export declare function resolveDataSearchMatches(hasMatchingRows: boolean, dataSearchTable: number | null | undefined, tables: SummaryTables): Map<number, number[]> | null;
|
|
@@ -103,8 +103,11 @@ function resolveSummaries(view, tables, logger) {
|
|
|
103
103
|
};
|
|
104
104
|
}
|
|
105
105
|
function resolveMatchingRows(view, tables) {
|
|
106
|
-
|
|
107
|
-
|
|
106
|
+
return resolveDataSearchMatches(view?.dataSearch.hasMatchingRows ?? false, view?.dataSearchTable?.dataTable, tables);
|
|
107
|
+
}
|
|
108
|
+
function resolveDataSearchMatches(hasMatchingRows, dataSearchTable, tables) {
|
|
109
|
+
if (!hasMatchingRows) return null;
|
|
110
|
+
const table = tables.table(dataSearchTable);
|
|
108
111
|
if (table == null) return EMPTY_MATCHES;
|
|
109
112
|
return once(table, () => parseDataSearchMatches(table));
|
|
110
113
|
}
|
|
@@ -147,4 +150,4 @@ function stringAnalysis(analysis, frequentValues, formatter) {
|
|
|
147
150
|
frequentValuePercentages: Float64Array.from(analysis.frequentValuePercentages)
|
|
148
151
|
};
|
|
149
152
|
}
|
|
150
|
-
export { LIST_COLUMN, ORDINAL_COLUMN, ROWNUMBER_COLUMN, SKIPPED_COLUMN, STRING_COLUMN, TaskStatus, resolveMatchingRows, resolveSummaries, resolveTableAggregation };
|
|
153
|
+
export { LIST_COLUMN, ORDINAL_COLUMN, ROWNUMBER_COLUMN, SKIPPED_COLUMN, STRING_COLUMN, TaskStatus, resolveDataSearchMatches, resolveMatchingRows, resolveSummaries, resolveTableAggregation };
|
|
@@ -1,10 +1,3 @@
|
|
|
1
1
|
import * as arrow from 'apache-arrow';
|
|
2
|
-
import type * as core from '../../core/index.js';
|
|
3
2
|
export declare const DATA_SEARCH_ROW_FIELD = "row_idx";
|
|
4
|
-
export interface SearchableResultColumn {
|
|
5
|
-
columnIdx: number;
|
|
6
|
-
columnGroupIdx: number;
|
|
7
|
-
fieldName: string;
|
|
8
|
-
}
|
|
9
|
-
export declare function collectSearchableResultColumns(columnGroups: core.ComputationColumnGroup[]): SearchableResultColumn[];
|
|
10
3
|
export declare function parseDataSearchMatches(table: arrow.Table): Map<number, number[]>;
|
|
@@ -1,23 +1,5 @@
|
|
|
1
1
|
// dist/.stage/src/platform/compute/query_result_search_sql.ts
|
|
2
2
|
var DATA_SEARCH_ROW_FIELD = "row_idx";
|
|
3
|
-
function collectSearchableResultColumns(columnGroups) {
|
|
4
|
-
const columns = [];
|
|
5
|
-
for (let columnGroupIdx = 0; columnGroupIdx < columnGroups.length; ++columnGroupIdx) {
|
|
6
|
-
const columnGroup = columnGroups[columnGroupIdx];
|
|
7
|
-
switch (columnGroup.type) {
|
|
8
|
-
case "ROWNUMBER":
|
|
9
|
-
case "SKIPPED": break;
|
|
10
|
-
case "ORDINAL":
|
|
11
|
-
case "STRING":
|
|
12
|
-
case "LIST": columns.push({
|
|
13
|
-
columnIdx: columns.length,
|
|
14
|
-
columnGroupIdx,
|
|
15
|
-
fieldName: columnGroup.value.inputFieldName
|
|
16
|
-
});
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
return columns;
|
|
20
|
-
}
|
|
21
3
|
function parseDataSearchMatches(table) {
|
|
22
4
|
const rowColumn = table.getChild("row_idx") ?? table.getChildAt(0);
|
|
23
5
|
const matchColumn = table.getChild("column_indices") ?? table.getChildAt(1);
|
|
@@ -31,4 +13,4 @@ function parseDataSearchMatches(table) {
|
|
|
31
13
|
}
|
|
32
14
|
return matches;
|
|
33
15
|
}
|
|
34
|
-
export { DATA_SEARCH_ROW_FIELD,
|
|
16
|
+
export { DATA_SEARCH_ROW_FIELD, parseDataSearchMatches };
|
|
@@ -1,19 +1,18 @@
|
|
|
1
1
|
import type * as app_workbook from '../../gen/jsonschema/app_workbook.js';
|
|
2
|
+
import * as core from '../../core/index.js';
|
|
2
3
|
import { ConnectorInfo } from './connector_info.js';
|
|
3
4
|
import type { ConnectionState, NewConnection } from './connection_state.js';
|
|
4
5
|
export type ConnectionParams = app_workbook.ConnectionParams;
|
|
5
6
|
export type HyperConnectionParams = app_workbook.HyperConnectionParams;
|
|
6
7
|
export type SalesforceConnectionParams = app_workbook.SalesforceConnectionParams;
|
|
7
8
|
export type TrinoConnectionParams = app_workbook.TrinoConnectionParams;
|
|
8
|
-
export declare function connectionParamsWithoutDraftRows(params: ConnectionParams): ConnectionParams;
|
|
9
|
+
export declare function connectionParamsWithoutDraftRows(core: core.DashQL, params: ConnectionParams): ConnectionParams;
|
|
9
10
|
export declare function connectionParamsKey(params: ConnectionParams | undefined): string;
|
|
10
11
|
export declare function getConnectionSetupParams(connection: Pick<ConnectionState, 'connectorType' | 'details'>): ConnectionParams | null;
|
|
11
|
-
export declare function connectionParamsHaveLoginHint(params: ConnectionParams | null): boolean;
|
|
12
|
+
export declare function connectionParamsHaveLoginHint(core: core.DashQL, params: ConnectionParams | null): boolean;
|
|
12
13
|
export type NewConnectionOptions = Pick<NewConnection, 'active' | 'name'>;
|
|
13
14
|
export declare function newConnectionFromParams(params: ConnectionParams, options?: NewConnectionOptions): NewConnection;
|
|
14
15
|
export declare function newDefaultHyperWasmConnection(options?: NewConnectionOptions): NewConnection;
|
|
15
|
-
export declare function createDefaultConnectionParamsForConnector(info: ConnectorInfo): ConnectionParams;
|
|
16
|
-
export declare function salesforceCatalogDatabase(): string;
|
|
17
|
-
export declare function hyperCloudDefaultDatabaseName(): string;
|
|
16
|
+
export declare function createDefaultConnectionParamsForConnector(core: core.DashQL, info: ConnectorInfo): ConnectionParams;
|
|
18
17
|
export declare const DEFAULT_HYPER_ENDPOINT = "http://localhost:7484";
|
|
19
|
-
export declare function createAttachedConnectionParamsForConnector(info: ConnectorInfo): ConnectionParams;
|
|
18
|
+
export declare function createAttachedConnectionParamsForConnector(core: core.DashQL, info: ConnectorInfo): ConnectionParams;
|