@loaders.gl/sql 5.0.0-alpha.12 → 5.0.0-alpha.14
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/LICENSE +1 -1
- package/README.md +2 -2
- package/dist/arrow-query.cjs +8 -8
- package/dist/arrow-query.cjs.map +2 -2
- package/dist/arrow-table-source.d.ts +3 -3
- package/dist/arrow-table-source.d.ts.map +1 -1
- package/dist/arrow-table-source.js +2 -2
- package/dist/arrow-table-source.js.map +1 -1
- package/dist/bind-sql-predicate.js +1 -1
- package/dist/bind-sql-predicate.js.map +1 -1
- package/dist/compile-table-query.d.ts +1 -1
- package/dist/compile-table-query.d.ts.map +1 -1
- package/dist/duckdb-sql-source.d.ts +22 -14
- package/dist/duckdb-sql-source.d.ts.map +1 -1
- package/dist/duckdb-sql-source.js +40 -16
- package/dist/duckdb-sql-source.js.map +1 -1
- package/dist/index.cjs +70 -50
- package/dist/index.cjs.map +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/query-arrow-table.d.ts +16 -16
- package/dist/query-arrow-table.d.ts.map +1 -1
- package/dist/query-arrow-table.js +2 -2
- package/dist/query-arrow-table.js.map +1 -1
- package/dist/snowflake-sql-source.d.ts +16 -13
- package/dist/snowflake-sql-source.d.ts.map +1 -1
- package/dist/snowflake-sql-source.js +1 -1
- package/dist/sql-predicate-types.d.ts +1 -1
- package/dist/sql-predicate-types.d.ts.map +1 -1
- package/dist/sql-predicate-types.js +1 -1
- package/dist/sql-predicate-types.js.map +1 -1
- package/dist/sql-predicate.cjs +1 -1
- package/dist/sql-predicate.cjs.map +1 -1
- package/dist/sql-source.d.ts +9 -9
- package/dist/sql-source.d.ts.map +1 -1
- package/dist/sql-source.js +1 -1
- package/dist/sql-source.js.map +1 -1
- package/dist/sql-types.d.ts +13 -2
- package/dist/sql-types.d.ts.map +1 -1
- package/dist/sql-utils.d.ts +1 -1
- package/dist/sql-utils.d.ts.map +1 -1
- package/dist/sql-utils.js +1 -1
- package/dist/sql-utils.js.map +1 -1
- package/dist/table-query-capabilities.d.ts +1 -1
- package/dist/table-query-capabilities.d.ts.map +1 -1
- package/dist/table-query.cjs +3 -3
- package/dist/table-query.cjs.map +2 -2
- package/dist/table-query.d.ts +2 -2
- package/dist/table-query.d.ts.map +1 -1
- package/dist/table-query.js +1 -1
- package/dist/table-query.js.map +1 -1
- package/package.json +2 -5
- package/src/arrow-table-source.ts +4 -4
- package/src/bind-sql-predicate.ts +1 -1
- package/src/compile-table-query.ts +1 -1
- package/src/duckdb-sql-source.ts +47 -19
- package/src/index.ts +2 -1
- package/src/query-arrow-table.ts +4 -4
- package/src/snowflake-sql-source.ts +2 -2
- package/src/sql-predicate-types.ts +1 -1
- package/src/sql-source.ts +3 -3
- package/src/sql-types.ts +14 -2
- package/src/sql-utils.ts +2 -2
- package/src/table-query-capabilities.ts +1 -1
- package/src/table-query.ts +3 -2
package/dist/table-query.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// loaders.gl
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
// Copyright (c) vis.gl contributors
|
|
4
|
-
import { getColumnarPredicateColumns, explainTableQuery as explainColumnarTableQuery, planTableQuery as planColumnarTableQuery } from '@loaders.gl/loader-utils';
|
|
4
|
+
import { getColumnarPredicateColumns, explainTableQuery as explainColumnarTableQuery, planTableQuery as planColumnarTableQuery } from '@loaders.gl/core/loader-utils';
|
|
5
5
|
import { validateSQLPredicate } from "./sql-predicate-schema.js";
|
|
6
6
|
import { SQL_DATA_SOURCE_TABLE_QUERY_CAPABILITIES } from "./table-query-capabilities.js";
|
|
7
7
|
/**
|
package/dist/table-query.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table-query.js","sourceRoot":"","sources":["../src/table-query.ts"],"names":[],"mappings":"AAAA,aAAa;AACb,+BAA+B;AAC/B,oCAAoC;AAEpC,OAAO,EACL,2BAA2B,EAC3B,iBAAiB,IAAI,yBAAyB,EAC9C,cAAc,IAAI,sBAAsB,EAQzC,MAAM,
|
|
1
|
+
{"version":3,"file":"table-query.js","sourceRoot":"","sources":["../src/table-query.ts"],"names":[],"mappings":"AAAA,aAAa;AACb,+BAA+B;AAC/B,oCAAoC;AAEpC,OAAO,EACL,2BAA2B,EAC3B,iBAAiB,IAAI,yBAAyB,EAC9C,cAAc,IAAI,sBAAsB,EAQzC,MAAM,+BAA+B,CAAC;AAEvC,OAAO,EAAC,oBAAoB,EAAC,kCAA+B;AAyB5D,OAAO,EAAC,wCAAwC,EAAC,sCAAmC;AAEpF;;;;;GAKG;AACH,MAAM,UAAU,cAAc,CAC5B,iBAAoC,EACpC,UAA6B,EAAE;IAE/B,IAAI,OAAO,CAAC,SAAS,EAAE,CAAC;QACtB,oBAAoB,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAC1C,CAAC;IACD,OAAO,sBAAsB,CAAC,iBAAiB,EAAE,OAAO,CAAC,CAAC;AAC5D,CAAC;AAED,gEAAgE;AAChE,MAAM,UAAU,iBAAiB,CAC/B,iBAAoC,EACpC,UAA6B,EAAE;IAE/B,IAAI,OAAO,CAAC,SAAS,EAAE,CAAC;QACtB,oBAAoB,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAC1C,CAAC;IACD,OAAO,yBAAyB,CAC9B,iBAAiB,EACjB,OAAO,EACP,wCAAwC,CACzC,CAAC;AACJ,CAAC;AAED,4FAA4F;AAC5F,MAAM,UAAU,0BAA0B,CAAC,SAAuB;IAChE,OAAO,2BAA2B,CAAC,SAAS,CAAC,CAAC;AAChD,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@loaders.gl/sql",
|
|
3
3
|
"description": "Framework-independent SQL data sources",
|
|
4
|
-
"version": "5.0.0-alpha.
|
|
4
|
+
"version": "5.0.0-alpha.14",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"publishConfig": {
|
|
@@ -63,9 +63,6 @@
|
|
|
63
63
|
"build-bundle": "# ocular-bundle ./bundle.ts --external:{util,fs,path}"
|
|
64
64
|
},
|
|
65
65
|
"dependencies": {
|
|
66
|
-
"@loaders.gl/loader-utils": "5.0.0-alpha.12",
|
|
67
|
-
"@loaders.gl/schema": "5.0.0-alpha.12",
|
|
68
|
-
"@loaders.gl/schema-utils": "5.0.0-alpha.12",
|
|
69
66
|
"apache-arrow": ">= 17.0.0"
|
|
70
67
|
},
|
|
71
68
|
"peerDependencies": {
|
|
@@ -90,5 +87,5 @@
|
|
|
90
87
|
"@duckdb/node-api": "^1.5.2-r.1",
|
|
91
88
|
"zod": "^4.1.12"
|
|
92
89
|
},
|
|
93
|
-
"gitHead": "
|
|
90
|
+
"gitHead": "226b7bca7ecb3684b7386487ee76565ca240d7d9"
|
|
94
91
|
}
|
|
@@ -6,15 +6,15 @@ import type {
|
|
|
6
6
|
DataSourceOptions,
|
|
7
7
|
ScanQueryMetadata,
|
|
8
8
|
ScanQueryMetadataOptions
|
|
9
|
-
} from '@loaders.gl/loader-utils';
|
|
9
|
+
} from '@loaders.gl/core/loader-utils';
|
|
10
10
|
import {
|
|
11
11
|
createScanQueryMetadata,
|
|
12
12
|
DataSource,
|
|
13
13
|
makeTableScanBatch,
|
|
14
14
|
type ScanColumnRole
|
|
15
|
-
} from '@loaders.gl/loader-utils';
|
|
16
|
-
import {convertArrowToSchema} from '@loaders.gl/schema-utils';
|
|
17
|
-
import type {ArrowTable, ArrowTableBatch} from '@loaders.gl/schema';
|
|
15
|
+
} from '@loaders.gl/core/loader-utils';
|
|
16
|
+
import {convertArrowToSchema} from '@loaders.gl/core/schema-utils';
|
|
17
|
+
import type {ArrowTable, ArrowTableBatch} from '@loaders.gl/core/schema';
|
|
18
18
|
import {
|
|
19
19
|
ARROW_TABLE_QUERY_CAPABILITIES,
|
|
20
20
|
explainArrowTableQuery,
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
// Copyright (c) vis.gl contributors
|
|
4
4
|
|
|
5
|
-
import {bindColumnarPredicateParameters} from '@loaders.gl/loader-utils';
|
|
5
|
+
import {bindColumnarPredicateParameters} from '@loaders.gl/core/loader-utils';
|
|
6
6
|
|
|
7
7
|
import {validateSQLPredicate} from './sql-predicate-schema';
|
|
8
8
|
import {
|
|
@@ -15,7 +15,7 @@ import type {
|
|
|
15
15
|
RelationalAggregate,
|
|
16
16
|
RelationalExpression,
|
|
17
17
|
RelationalOrderKey
|
|
18
|
-
} from '@loaders.gl/loader-utils';
|
|
18
|
+
} from '@loaders.gl/core/loader-utils';
|
|
19
19
|
|
|
20
20
|
/** A named child relation using the SQL module's property-oriented predicate AST. */
|
|
21
21
|
type SQLChildQuery = Readonly<{
|
package/src/duckdb-sql-source.ts
CHANGED
|
@@ -2,9 +2,11 @@
|
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
// Copyright (c) vis.gl contributors
|
|
4
4
|
|
|
5
|
-
import
|
|
6
|
-
import type {
|
|
7
|
-
import {
|
|
5
|
+
import {tableFromIPC, tableToIPC} from 'apache-arrow';
|
|
6
|
+
import type {AsyncDuckDBConnection} from '@duckdb/duckdb-wasm';
|
|
7
|
+
import type {ArrowTable, Schema} from '@loaders.gl/core/schema';
|
|
8
|
+
import type {SourceLoader, CoreAPI} from '@loaders.gl/core/loader-utils';
|
|
9
|
+
import {convertArrowToTable} from '@loaders.gl/core/schema-utils';
|
|
8
10
|
|
|
9
11
|
import {SQLDataSource, SQL_SOURCE_DEFAULT_OPTIONS} from './sql-source';
|
|
10
12
|
import type {
|
|
@@ -14,7 +16,8 @@ import type {
|
|
|
14
16
|
SQLColumnInfo,
|
|
15
17
|
SQLQueryOptions,
|
|
16
18
|
SQLSourceOptions,
|
|
17
|
-
SQLTableInfo
|
|
19
|
+
SQLTableInfo,
|
|
20
|
+
SQLArrowInsertOptions
|
|
18
21
|
} from './sql-types';
|
|
19
22
|
import {
|
|
20
23
|
convertRowsToArrowTable,
|
|
@@ -75,6 +78,20 @@ export const DuckDBSQLSource = {
|
|
|
75
78
|
|
|
76
79
|
/** SQLDataSource specialization for DuckDB. */
|
|
77
80
|
export class DuckDBSQLDataSource extends SQLDataSource {
|
|
81
|
+
/** Uploads an Arrow table through IPC. Supported by the browser DuckDB-Wasm adapter. */
|
|
82
|
+
async insertArrowTable(table: ArrowTable, options: SQLArrowInsertOptions): Promise<void> {
|
|
83
|
+
await this.insertArrowIPC(tableToIPC(table.data, 'stream'), options);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/** Uploads a complete Arrow IPC stream to a browser DuckDB-Wasm table. */
|
|
87
|
+
async insertArrowIPC(bytes: Uint8Array, options: SQLArrowInsertOptions): Promise<void> {
|
|
88
|
+
const adapter = await this.getAdapter();
|
|
89
|
+
if (!adapter.insertArrowIPC) {
|
|
90
|
+
throw new Error('This DuckDB adapter does not support Arrow IPC uploads.');
|
|
91
|
+
}
|
|
92
|
+
await adapter.insertArrowIPC(bytes, options);
|
|
93
|
+
}
|
|
94
|
+
|
|
78
95
|
constructor(data: string, options: SQLSourceOptions, coreApi?: CoreAPI) {
|
|
79
96
|
super(
|
|
80
97
|
data,
|
|
@@ -253,7 +270,7 @@ async function createDuckDBBrowserAdapter(context: SQLAdapterFactoryContext): Pr
|
|
|
253
270
|
options: SQLQueryOptions = {}
|
|
254
271
|
): Promise<Record<string, unknown>[]> => {
|
|
255
272
|
const result = await executeDuckDBBrowserQuery(connection, sqlText, options.parameters);
|
|
256
|
-
return convertArrowToTable(result, 'object-row-table').data;
|
|
273
|
+
return convertArrowToTable(tableFromIPC(result), 'object-row-table').data;
|
|
257
274
|
};
|
|
258
275
|
|
|
259
276
|
return {
|
|
@@ -263,6 +280,14 @@ async function createDuckDBBrowserAdapter(context: SQLAdapterFactoryContext): Pr
|
|
|
263
280
|
runtime: 'browser',
|
|
264
281
|
isDynamic: true
|
|
265
282
|
},
|
|
283
|
+
async insertArrowIPC(bytes, options): Promise<void> {
|
|
284
|
+
// DuckDB transfers the buffer to its worker; retain the caller's IPC bytes.
|
|
285
|
+
await connection.insertArrowFromIPCStream(new Uint8Array(bytes), {
|
|
286
|
+
name: options.tableName,
|
|
287
|
+
schema: options.schemaName,
|
|
288
|
+
create: options.create ?? true
|
|
289
|
+
});
|
|
290
|
+
},
|
|
266
291
|
async connect(): Promise<void> {},
|
|
267
292
|
async close(): Promise<void> {
|
|
268
293
|
await connection.close();
|
|
@@ -355,27 +380,30 @@ async function createDuckDBBrowserAdapter(context: SQLAdapterFactoryContext): Pr
|
|
|
355
380
|
},
|
|
356
381
|
async executeArrow(sqlText: string, options: SQLQueryOptions = {}) {
|
|
357
382
|
const result = await executeDuckDBBrowserQuery(connection, sqlText, options.parameters);
|
|
358
|
-
return convertArrowToTable(result, 'arrow-table');
|
|
383
|
+
return convertArrowToTable(tableFromIPC(result), 'arrow-table');
|
|
359
384
|
}
|
|
360
385
|
};
|
|
361
386
|
}
|
|
362
387
|
|
|
363
|
-
/**
|
|
388
|
+
/** Returns raw IPC so DuckDB's Arrow objects never cross into loaders.gl's Arrow runtime. */
|
|
364
389
|
async function executeDuckDBBrowserQuery(
|
|
365
|
-
connection:
|
|
390
|
+
connection: AsyncDuckDBConnection,
|
|
366
391
|
sqlText: string,
|
|
367
392
|
parameters?: SQLQueryOptions['parameters']
|
|
368
|
-
): Promise<
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
393
|
+
): Promise<Uint8Array> {
|
|
394
|
+
// Keep DuckDB's lower-level connection handle confined to this IPC boundary.
|
|
395
|
+
return await connection.useUnsafe(async (bindings, connectionId) => {
|
|
396
|
+
if (!parameters) {
|
|
397
|
+
return await bindings.runQuery(connectionId, sqlText);
|
|
398
|
+
}
|
|
399
|
+
const values = Array.isArray(parameters) ? parameters : Object.values(parameters);
|
|
400
|
+
const statementId = await bindings.createPrepared(connectionId, sqlText);
|
|
401
|
+
try {
|
|
402
|
+
return await bindings.runPrepared(connectionId, statementId, values);
|
|
403
|
+
} finally {
|
|
404
|
+
await bindings.closePrepared(connectionId, statementId);
|
|
405
|
+
}
|
|
406
|
+
});
|
|
379
407
|
}
|
|
380
408
|
|
|
381
409
|
function getDuckDBDatabasePath(url: string, options: SQLSourceOptions): string {
|
package/src/index.ts
CHANGED
|
@@ -50,6 +50,7 @@ export type {
|
|
|
50
50
|
SQLParameterValues,
|
|
51
51
|
SQLQuery,
|
|
52
52
|
SQLQueryOptions,
|
|
53
|
+
SQLArrowInsertOptions,
|
|
53
54
|
SQLSchemaInfo,
|
|
54
55
|
SQLSourceOptions,
|
|
55
56
|
SQLTableInfo
|
|
@@ -67,7 +68,7 @@ export type {
|
|
|
67
68
|
RelationalAggregate,
|
|
68
69
|
RelationalExpression,
|
|
69
70
|
RelationalOrderKey
|
|
70
|
-
} from '@loaders.gl/loader-utils';
|
|
71
|
+
} from '@loaders.gl/core/loader-utils';
|
|
71
72
|
export type {
|
|
72
73
|
TableQueryFilterStep,
|
|
73
74
|
TableQueryLimitStep,
|
package/src/query-arrow-table.ts
CHANGED
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
// Copyright (c) vis.gl contributors
|
|
4
4
|
|
|
5
5
|
import * as arrow from 'apache-arrow';
|
|
6
|
-
import type {ArrowTable} from '@loaders.gl/schema';
|
|
7
|
-
import {convertArrowToSchema} from '@loaders.gl/schema-utils';
|
|
6
|
+
import type {ArrowTable} from '@loaders.gl/core/schema';
|
|
7
|
+
import {convertArrowToSchema} from '@loaders.gl/core/schema-utils';
|
|
8
8
|
import {convertRowsToArrowTable} from './sql-utils';
|
|
9
9
|
|
|
10
10
|
import {
|
|
@@ -31,11 +31,11 @@ import type {
|
|
|
31
31
|
RelationalAggregate,
|
|
32
32
|
RelationalExpression,
|
|
33
33
|
RelationalOrderKey
|
|
34
|
-
} from '@loaders.gl/loader-utils';
|
|
34
|
+
} from '@loaders.gl/core/loader-utils';
|
|
35
35
|
import {
|
|
36
36
|
explainTableQuery as explainColumnarTableQuery,
|
|
37
37
|
planRelationalQuery
|
|
38
|
-
} from '@loaders.gl/loader-utils';
|
|
38
|
+
} from '@loaders.gl/core/loader-utils';
|
|
39
39
|
import {ARROW_TABLE_QUERY_CAPABILITIES} from './table-query-capabilities';
|
|
40
40
|
import {validateSQLPredicate} from './sql-predicate-schema';
|
|
41
41
|
export {ARROW_TABLE_QUERY_CAPABILITIES};
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
// Copyright (c) vis.gl contributors
|
|
4
4
|
|
|
5
|
-
import type {Schema} from '@loaders.gl/schema';
|
|
6
|
-
import type {SourceLoader, CoreAPI} from '@loaders.gl/loader-utils';
|
|
5
|
+
import type {Schema} from '@loaders.gl/core/schema';
|
|
6
|
+
import type {SourceLoader, CoreAPI} from '@loaders.gl/core/loader-utils';
|
|
7
7
|
|
|
8
8
|
import {SQLDataSource, SQL_SOURCE_DEFAULT_OPTIONS} from './sql-source';
|
|
9
9
|
import type {
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
type ColumnarPredicateParameter,
|
|
15
15
|
type ColumnarPredicateParameterValues,
|
|
16
16
|
type ColumnarPredicateValue
|
|
17
|
-
} from '@loaders.gl/loader-utils';
|
|
17
|
+
} from '@loaders.gl/core/loader-utils';
|
|
18
18
|
|
|
19
19
|
/** Scalar values supported by portable SQL predicate expressions. */
|
|
20
20
|
export type SQLPredicateScalar = ColumnarPredicateValue;
|
package/src/sql-source.ts
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
// Copyright (c) vis.gl contributors
|
|
4
4
|
|
|
5
|
-
import type {ArrowTable, Schema} from '@loaders.gl/schema';
|
|
6
|
-
import {DataSource} from '@loaders.gl/loader-utils';
|
|
7
|
-
import type {CoreAPI, RequiredOptions} from '@loaders.gl/loader-utils';
|
|
5
|
+
import type {ArrowTable, Schema} from '@loaders.gl/core/schema';
|
|
6
|
+
import {DataSource} from '@loaders.gl/core/loader-utils';
|
|
7
|
+
import type {CoreAPI, RequiredOptions} from '@loaders.gl/core/loader-utils';
|
|
8
8
|
|
|
9
9
|
import type {
|
|
10
10
|
SQLAdapter,
|
package/src/sql-types.ts
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
// Copyright (c) vis.gl contributors
|
|
4
4
|
|
|
5
|
-
import type {ArrowTable, Schema} from '@loaders.gl/schema';
|
|
6
|
-
import type {CoreAPI, DataSourceOptions} from '@loaders.gl/loader-utils';
|
|
5
|
+
import type {ArrowTable, Schema} from '@loaders.gl/core/schema';
|
|
6
|
+
import type {CoreAPI, DataSourceOptions} from '@loaders.gl/core/loader-utils';
|
|
7
7
|
import type {SQLTableQuery} from './compile-table-query';
|
|
8
8
|
|
|
9
9
|
export type SQLParameterValues = unknown[] | Record<string, unknown>;
|
|
@@ -64,6 +64,16 @@ export type SQLAdapterCapabilities = {
|
|
|
64
64
|
isDynamic?: boolean;
|
|
65
65
|
};
|
|
66
66
|
|
|
67
|
+
/** Destination for an Arrow IPC upload. */
|
|
68
|
+
export type SQLArrowInsertOptions = {
|
|
69
|
+
/** Destination table name. */
|
|
70
|
+
tableName: string;
|
|
71
|
+
/** Destination schema, defaulting to DuckDB's default schema. */
|
|
72
|
+
schemaName?: string;
|
|
73
|
+
/** Create a table when true (default); append to an existing table when false. */
|
|
74
|
+
create?: boolean;
|
|
75
|
+
};
|
|
76
|
+
|
|
67
77
|
/** Runtime adapter interface used by SQL-backed data sources. */
|
|
68
78
|
export interface SQLAdapter {
|
|
69
79
|
readonly capabilities: SQLAdapterCapabilities;
|
|
@@ -78,6 +88,8 @@ export interface SQLAdapter {
|
|
|
78
88
|
tableName: string;
|
|
79
89
|
}): Promise<Schema>;
|
|
80
90
|
executeRows(sql: string, options?: SQLQueryOptions): Promise<Record<string, unknown>[]>;
|
|
91
|
+
/** Uploads an Arrow IPC stream without passing Arrow runtime objects. */
|
|
92
|
+
insertArrowIPC?(bytes: Uint8Array, options: SQLArrowInsertOptions): Promise<void>;
|
|
81
93
|
executeArrow?(sql: string, options?: SQLQueryOptions): Promise<ArrowTable>;
|
|
82
94
|
}
|
|
83
95
|
|
package/src/sql-utils.ts
CHANGED
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
// Copyright (c) vis.gl contributors
|
|
4
4
|
|
|
5
5
|
import * as arrow from 'apache-arrow';
|
|
6
|
-
import type {ArrowTable, DataType, Field, ObjectRowTable, Schema} from '@loaders.gl/schema';
|
|
7
|
-
import {makeTableFromData, getDataTypeFromArray} from '@loaders.gl/schema-utils';
|
|
6
|
+
import type {ArrowTable, DataType, Field, ObjectRowTable, Schema} from '@loaders.gl/core/schema';
|
|
7
|
+
import {makeTableFromData, getDataTypeFromArray} from '@loaders.gl/core/schema-utils';
|
|
8
8
|
|
|
9
9
|
import type {SQLColumnInfo} from './sql-types';
|
|
10
10
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
// Copyright (c) vis.gl contributors
|
|
4
4
|
|
|
5
|
-
import type {TableQueryCapabilities} from '@loaders.gl/loader-utils';
|
|
5
|
+
import type {TableQueryCapabilities} from '@loaders.gl/core/loader-utils';
|
|
6
6
|
|
|
7
7
|
/** Portable query capabilities of the in-memory Arrow executor. */
|
|
8
8
|
export const ARROW_TABLE_QUERY_CAPABILITIES: TableQueryCapabilities = Object.freeze({
|
package/src/table-query.ts
CHANGED
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
type TableQueryPlanStep as ColumnarTableQueryPlanStep,
|
|
14
14
|
type TableQueryProjectStep as ColumnarTableQueryProjectStep,
|
|
15
15
|
type TableQueryScanStep as ColumnarTableQueryScanStep
|
|
16
|
-
} from '@loaders.gl/loader-utils';
|
|
16
|
+
} from '@loaders.gl/core/loader-utils';
|
|
17
17
|
|
|
18
18
|
import {validateSQLPredicate} from './sql-predicate-schema';
|
|
19
19
|
import type {SQLPredicate} from './sql-predicate-types';
|
|
@@ -38,7 +38,8 @@ export type TableQueryPlanStep = ColumnarTableQueryPlanStep<SQLPredicate>;
|
|
|
38
38
|
|
|
39
39
|
/** Immutable logical query plan shared by Arrow and GPU dataframe backends. */
|
|
40
40
|
export type TableQueryPlan = ColumnarTableQueryPlan<SQLPredicate>;
|
|
41
|
-
export type TableQueryExplain =
|
|
41
|
+
export type TableQueryExplain =
|
|
42
|
+
import('@loaders.gl/core/loader-utils').TableQueryExplain<SQLPredicate>;
|
|
42
43
|
import {SQL_DATA_SOURCE_TABLE_QUERY_CAPABILITIES} from './table-query-capabilities';
|
|
43
44
|
|
|
44
45
|
/**
|