@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/index.cjs
CHANGED
|
@@ -55,8 +55,8 @@ __export(index_exports, {
|
|
|
55
55
|
});
|
|
56
56
|
module.exports = __toCommonJS(index_exports);
|
|
57
57
|
|
|
58
|
-
// ../loader-utils/
|
|
59
|
-
var import_log = require("
|
|
58
|
+
// ../core/src/loader-utils/lib/log-utils/log.ts
|
|
59
|
+
var import_log = require("probe.gl/log");
|
|
60
60
|
var VERSION = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
|
|
61
61
|
var version = VERSION[0] >= "0" && VERSION[0] <= "9" ? `v${VERSION}` : "";
|
|
62
62
|
function createLog() {
|
|
@@ -70,11 +70,11 @@ function createLog() {
|
|
|
70
70
|
}
|
|
71
71
|
var log = createLog();
|
|
72
72
|
|
|
73
|
-
// ../loader-utils/
|
|
73
|
+
// ../core/src/loader-utils/lib/javascript-utils/is-type.ts
|
|
74
74
|
var isObject = (value) => value !== null && typeof value === "object";
|
|
75
75
|
var isPureObject = (value) => isObject(value) && value.constructor === {}.constructor;
|
|
76
76
|
|
|
77
|
-
// ../loader-utils/
|
|
77
|
+
// ../core/src/loader-utils/lib/option-utils/merge-options.ts
|
|
78
78
|
function mergeOptions(baseOptions, newOptions) {
|
|
79
79
|
return mergeOptionsRecursively(baseOptions || {}, newOptions);
|
|
80
80
|
}
|
|
@@ -97,7 +97,7 @@ function mergeOptionsRecursively(baseOptions, newOptions, level = 0) {
|
|
|
97
97
|
return options;
|
|
98
98
|
}
|
|
99
99
|
|
|
100
|
-
// ../loader-utils/
|
|
100
|
+
// ../core/src/loader-utils/lib/request-utils/authentication.ts
|
|
101
101
|
function resolveCredentials(credentials, authentications = []) {
|
|
102
102
|
if (credentials.every(isAuthentication)) return credentials;
|
|
103
103
|
return credentials.map((credential, index) => {
|
|
@@ -134,7 +134,7 @@ function isAuthentication(credential) {
|
|
|
134
134
|
return (credential.type === "header" || credential.type === "query-parameter") && typeof credential.name === "string" && (typeof credential.token === "string" || typeof credential.token === "function") && Array.isArray(credential.refreshStatusCodes);
|
|
135
135
|
}
|
|
136
136
|
|
|
137
|
-
// ../loader-utils/
|
|
137
|
+
// ../core/src/loader-utils/lib/request-utils/request-credentials.ts
|
|
138
138
|
var AUTHENTICATED_FETCH = /* @__PURE__ */ Symbol("loaders.gl.authenticated-fetch");
|
|
139
139
|
var refreshPromises = /* @__PURE__ */ new WeakMap();
|
|
140
140
|
function createAuthenticatedFetch(options) {
|
|
@@ -168,7 +168,7 @@ function createAuthenticatedFetch(options) {
|
|
|
168
168
|
const authenticatedFetch = async (url, requestOptions = {}) => {
|
|
169
169
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
170
170
|
requestOptions = mergeFetchOptions(fetchOptions, requestOptions);
|
|
171
|
-
|
|
171
|
+
(_a = requestOptions.signal) == null ? void 0 : _a.throwIfAborted();
|
|
172
172
|
if (!credentials.length) return baseFetch(url, requestOptions);
|
|
173
173
|
const resolvedURL = parseHTTPURL(url);
|
|
174
174
|
const authorization = resolvedURL ? await authorizeRequest(resolvedURL, requestOptions, tokenCredentials) : { url, options: requestOptions, credentials: [] };
|
|
@@ -187,7 +187,7 @@ function createAuthenticatedFetch(options) {
|
|
|
187
187
|
}
|
|
188
188
|
);
|
|
189
189
|
if (!refreshableCredentials.length && !shouldRetrySignature) return response;
|
|
190
|
-
|
|
190
|
+
(_e = requestOptions.signal) == null ? void 0 : _e.throwIfAborted();
|
|
191
191
|
const refreshedTokens = /* @__PURE__ */ new Map();
|
|
192
192
|
await Promise.all(
|
|
193
193
|
refreshableCredentials.map(async ({ credential }) => {
|
|
@@ -198,7 +198,7 @@ function createAuthenticatedFetch(options) {
|
|
|
198
198
|
if (!refreshedTokens.size && !shouldRetrySignature) return response;
|
|
199
199
|
await ((_f = response.body) == null ? void 0 : _f.cancel().catch(() => {
|
|
200
200
|
}));
|
|
201
|
-
|
|
201
|
+
(_g = requestOptions.signal) == null ? void 0 : _g.throwIfAborted();
|
|
202
202
|
const replayAuthorization = resolvedURL ? await authorizeRequest(
|
|
203
203
|
resolvedURL,
|
|
204
204
|
requestOptions,
|
|
@@ -233,9 +233,10 @@ function getAuthenticatedFetch(options = {}) {
|
|
|
233
233
|
} else {
|
|
234
234
|
fetchFunction = (url, requestOptions) => fetch(url, requestOptions);
|
|
235
235
|
}
|
|
236
|
+
const fetchOptions = typeof fetchOption === "object" && fetchOption ? fetchOption : void 0;
|
|
236
237
|
return createAuthenticatedFetch({
|
|
237
238
|
fetch: fetchFunction,
|
|
238
|
-
fetchOptions:
|
|
239
|
+
fetchOptions: options.signal ? { ...fetchOptions, signal: options.signal } : fetchOptions,
|
|
239
240
|
credentials: ((_b = options.core) == null ? void 0 : _b.credentials) || [],
|
|
240
241
|
authentications: (_c = options.core) == null ? void 0 : _c.authentications
|
|
241
242
|
});
|
|
@@ -255,7 +256,7 @@ async function authenticateRequest(request, credentials, reason, response) {
|
|
|
255
256
|
for (const credential of credentials) {
|
|
256
257
|
const origin = getRequestOrigin(request.url);
|
|
257
258
|
if (!origin || !normalizeRequestOrigins(credential.origins).includes(origin)) continue;
|
|
258
|
-
|
|
259
|
+
signal == null ? void 0 : signal.throwIfAborted();
|
|
259
260
|
const authenticatedRequest = await credential.authenticate({
|
|
260
261
|
url: request.url,
|
|
261
262
|
options: { ...request.options, headers: new Headers(request.options.headers) },
|
|
@@ -271,7 +272,7 @@ async function authenticateRequest(request, credentials, reason, response) {
|
|
|
271
272
|
};
|
|
272
273
|
appliedCredentials.push(credential);
|
|
273
274
|
}
|
|
274
|
-
|
|
275
|
+
signal == null ? void 0 : signal.throwIfAborted();
|
|
275
276
|
return { ...request, credentials: appliedCredentials };
|
|
276
277
|
}
|
|
277
278
|
function getRequestOrigin(url) {
|
|
@@ -361,11 +362,8 @@ function isReplayableRequest(options) {
|
|
|
361
362
|
if (!["GET", "HEAD", "OPTIONS", "PUT", "DELETE"].includes(method)) return false;
|
|
362
363
|
return !(options.body && typeof ReadableStream !== "undefined" && options.body instanceof ReadableStream);
|
|
363
364
|
}
|
|
364
|
-
function createAbortError() {
|
|
365
|
-
return new DOMException("The operation was aborted.", "AbortError");
|
|
366
|
-
}
|
|
367
365
|
|
|
368
|
-
// ../loader-utils/
|
|
366
|
+
// ../core/src/loader-utils/lib/path-utils/file-aliases.ts
|
|
369
367
|
var pathPrefix = "";
|
|
370
368
|
var fileAliases = {};
|
|
371
369
|
function resolvePath(filename) {
|
|
@@ -381,7 +379,7 @@ function resolvePath(filename) {
|
|
|
381
379
|
return filename;
|
|
382
380
|
}
|
|
383
381
|
|
|
384
|
-
// ../loader-utils/
|
|
382
|
+
// ../core/src/loader-utils/lib/sources/data-source.ts
|
|
385
383
|
var UNAVAILABLE_CORE_API = {
|
|
386
384
|
fetchFile: unavailableCoreApiMethod("fetchFile"),
|
|
387
385
|
parse: unavailableCoreApiMethod("parse"),
|
|
@@ -513,7 +511,7 @@ function unavailableCoreApiMethod(methodName) {
|
|
|
513
511
|
};
|
|
514
512
|
}
|
|
515
513
|
|
|
516
|
-
// ../loader-utils/
|
|
514
|
+
// ../core/src/loader-utils/lib/scan-utils/columnar-predicate.ts
|
|
517
515
|
function getColumnarPredicateColumns(predicate) {
|
|
518
516
|
return [...new Set(getColumnarPredicatePaths(predicate).map((path) => path[0]))];
|
|
519
517
|
}
|
|
@@ -624,8 +622,8 @@ function copyColumnarPredicateValue(value) {
|
|
|
624
622
|
return value;
|
|
625
623
|
}
|
|
626
624
|
|
|
627
|
-
// ../loader-utils/
|
|
628
|
-
var import_crs = require("@math.gl/crs");
|
|
625
|
+
// ../core/src/loader-utils/lib/scan-utils/scan-query-metadata.ts
|
|
626
|
+
var import_crs = require("@math.gl/geospatial/crs");
|
|
629
627
|
function createScanQueryMetadata(options) {
|
|
630
628
|
validateScanExecutionSupport(options.queryType, options.execution);
|
|
631
629
|
const schema = Object.freeze({
|
|
@@ -702,7 +700,7 @@ function getNonEmptyMetadataValue(metadata, key) {
|
|
|
702
700
|
return value || void 0;
|
|
703
701
|
}
|
|
704
702
|
|
|
705
|
-
// ../loader-utils/
|
|
703
|
+
// ../core/src/loader-utils/lib/scan-utils/table-query.ts
|
|
706
704
|
function planTableQuery(sourceColumnNames, options = {}) {
|
|
707
705
|
validateTableQueryOptions(sourceColumnNames, options);
|
|
708
706
|
const outputColumnNames = options.columns ? [...options.columns] : [...sourceColumnNames];
|
|
@@ -747,12 +745,12 @@ function validateTableQueryLimit(limit) {
|
|
|
747
745
|
}
|
|
748
746
|
}
|
|
749
747
|
|
|
750
|
-
// ../loader-utils/
|
|
748
|
+
// ../core/src/loader-utils/lib/scan-utils/table-scan-batch.ts
|
|
751
749
|
function makeTableScanBatch(table) {
|
|
752
750
|
return { ...table, batchType: "data", length: table.data.numRows };
|
|
753
751
|
}
|
|
754
752
|
|
|
755
|
-
// ../loader-utils/
|
|
753
|
+
// ../core/src/loader-utils/lib/scan-utils/relational-query.ts
|
|
756
754
|
function planRelationalQuery(sourceColumnNames, options = {}) {
|
|
757
755
|
var _a, _b, _c, _d, _e, _f;
|
|
758
756
|
const available = new Set(sourceColumnNames);
|
|
@@ -842,7 +840,7 @@ function validateRelationalColumnReference(columnName, availableColumns) {
|
|
|
842
840
|
}
|
|
843
841
|
}
|
|
844
842
|
|
|
845
|
-
// ../loader-utils/
|
|
843
|
+
// ../core/src/loader-utils/lib/scan-utils/table-query-explain.ts
|
|
846
844
|
function explainTableQuery(sourceColumnNames, options, capabilities) {
|
|
847
845
|
const plan = planTableQuery(sourceColumnNames, options);
|
|
848
846
|
const outputColumns = options.columns ? [...options.columns] : [...sourceColumnNames];
|
|
@@ -1289,8 +1287,8 @@ function validateSQLIdentifier(identifier) {
|
|
|
1289
1287
|
// dist/sql-utils.js
|
|
1290
1288
|
var arrow5 = __toESM(require("apache-arrow"), 1);
|
|
1291
1289
|
|
|
1292
|
-
// ../schema-utils/
|
|
1293
|
-
var import_types = require("@math.gl/types");
|
|
1290
|
+
// ../core/src/schema-utils/lib/schema/data-type.ts
|
|
1291
|
+
var import_types = require("@math.gl/core/types");
|
|
1294
1292
|
function getDataTypeFromValue(value, defaultNumberType = "float32") {
|
|
1295
1293
|
if (value instanceof Date) {
|
|
1296
1294
|
return "date-millisecond";
|
|
@@ -1378,7 +1376,7 @@ function getArrayTypeFromDataType(type, nullable) {
|
|
|
1378
1376
|
return Array;
|
|
1379
1377
|
}
|
|
1380
1378
|
|
|
1381
|
-
// ../schema-utils/
|
|
1379
|
+
// ../core/src/schema-utils/lib/schema/convert-arrow-schema.ts
|
|
1382
1380
|
var arrow = __toESM(require("apache-arrow"), 1);
|
|
1383
1381
|
function convertArrowToSchema(arrowSchema) {
|
|
1384
1382
|
return serializeArrowSchema(arrowSchema);
|
|
@@ -1814,7 +1812,7 @@ function deserializeArrowDictionaryKeyType(keyType) {
|
|
|
1814
1812
|
}
|
|
1815
1813
|
}
|
|
1816
1814
|
|
|
1817
|
-
// ../schema-utils/
|
|
1815
|
+
// ../core/src/schema-utils/lib/schema/deduce-table-schema.ts
|
|
1818
1816
|
function deduceTableSchema(table) {
|
|
1819
1817
|
switch (table.shape) {
|
|
1820
1818
|
case "array-row-table":
|
|
@@ -1891,7 +1889,7 @@ function deduceFieldFromValue(value, name) {
|
|
|
1891
1889
|
};
|
|
1892
1890
|
}
|
|
1893
1891
|
|
|
1894
|
-
// ../schema-utils/
|
|
1892
|
+
// ../core/src/schema-utils/lib/table/tables/make-table.ts
|
|
1895
1893
|
var arrow2 = __toESM(require("apache-arrow"), 1);
|
|
1896
1894
|
function makeTableFromData(data) {
|
|
1897
1895
|
let table;
|
|
@@ -1936,7 +1934,7 @@ function getTableShapeFromData(data) {
|
|
|
1936
1934
|
throw new Error("invalid table");
|
|
1937
1935
|
}
|
|
1938
1936
|
|
|
1939
|
-
// ../schema-utils/
|
|
1937
|
+
// ../core/src/schema-utils/lib/table/tables/table-accessors.ts
|
|
1940
1938
|
function getTableLength(table) {
|
|
1941
1939
|
switch (table.shape) {
|
|
1942
1940
|
case "array-row-table":
|
|
@@ -2141,16 +2139,16 @@ function getTableRowAsArray(table, rowIndex, target, copy) {
|
|
|
2141
2139
|
}
|
|
2142
2140
|
}
|
|
2143
2141
|
|
|
2144
|
-
// ../schema-utils/
|
|
2142
|
+
// ../core/src/schema-utils/lib/table/tables/table-column.ts
|
|
2145
2143
|
function makeColumnFromField(field, length) {
|
|
2146
2144
|
const ArrayType = getArrayTypeFromDataType(field.type, field.nullable);
|
|
2147
2145
|
return new ArrayType(length);
|
|
2148
2146
|
}
|
|
2149
2147
|
|
|
2150
|
-
// ../schema-utils/
|
|
2148
|
+
// ../core/src/schema-utils/lib/table/tables/convert-arrow-table.ts
|
|
2151
2149
|
var arrow4 = __toESM(require("apache-arrow"), 1);
|
|
2152
2150
|
|
|
2153
|
-
// ../schema-utils/
|
|
2151
|
+
// ../core/src/schema-utils/lib/table/batches/make-arrow-batch-iterator.ts
|
|
2154
2152
|
var arrow3 = __toESM(require("apache-arrow"), 1);
|
|
2155
2153
|
function* makeArrowRecordBatchIterator(table, options) {
|
|
2156
2154
|
const arrowSchema = convertSchemaToArrow(table.schema);
|
|
@@ -2188,7 +2186,7 @@ function* makeArrowRecordBatchIterator(table, options) {
|
|
|
2188
2186
|
builders.map((builder) => builder.finish());
|
|
2189
2187
|
}
|
|
2190
2188
|
|
|
2191
|
-
// ../schema-utils/
|
|
2189
|
+
// ../core/src/schema-utils/lib/table/tables/convert-arrow-table.ts
|
|
2192
2190
|
function convertTableToArrow(table, options) {
|
|
2193
2191
|
switch (table.shape) {
|
|
2194
2192
|
case "arrow-table":
|
|
@@ -2263,7 +2261,7 @@ function convertArrowToGeoJSONTable(arrowTable) {
|
|
|
2263
2261
|
};
|
|
2264
2262
|
}
|
|
2265
2263
|
|
|
2266
|
-
// ../schema-utils/
|
|
2264
|
+
// ../core/src/schema-utils/lib/table/tables/convert-table.ts
|
|
2267
2265
|
function convertTable(table, shape) {
|
|
2268
2266
|
switch (shape) {
|
|
2269
2267
|
case "object-row-table":
|
|
@@ -2339,7 +2337,7 @@ function convertToArrowTable(table) {
|
|
|
2339
2337
|
};
|
|
2340
2338
|
}
|
|
2341
2339
|
|
|
2342
|
-
// ../schema-utils/
|
|
2340
|
+
// ../core/src/schema-utils/deprecated.ts
|
|
2343
2341
|
var convertArrowToTable2 = ((...args) => convertArrowToTable(
|
|
2344
2342
|
...args
|
|
2345
2343
|
));
|
|
@@ -3271,7 +3269,8 @@ function throwIfAborted2(signal) {
|
|
|
3271
3269
|
}
|
|
3272
3270
|
|
|
3273
3271
|
// dist/duckdb-sql-source.js
|
|
3274
|
-
var
|
|
3272
|
+
var import_apache_arrow = require("apache-arrow");
|
|
3273
|
+
var VERSION2 = true ? "5.0.0-alpha.14" : "latest";
|
|
3275
3274
|
var DuckDBSQLSource = {
|
|
3276
3275
|
dataType: null,
|
|
3277
3276
|
batchType: null,
|
|
@@ -3313,6 +3312,18 @@ var DuckDBSQLSource = {
|
|
|
3313
3312
|
createDataSource: (data, options, coreApi) => new DuckDBSQLDataSource(data, options, coreApi)
|
|
3314
3313
|
};
|
|
3315
3314
|
var DuckDBSQLDataSource = class extends SQLDataSource {
|
|
3315
|
+
/** Uploads an Arrow table through IPC. Supported by the browser DuckDB-Wasm adapter. */
|
|
3316
|
+
async insertArrowTable(table, options) {
|
|
3317
|
+
await this.insertArrowIPC((0, import_apache_arrow.tableToIPC)(table.data, "stream"), options);
|
|
3318
|
+
}
|
|
3319
|
+
/** Uploads a complete Arrow IPC stream to a browser DuckDB-Wasm table. */
|
|
3320
|
+
async insertArrowIPC(bytes, options) {
|
|
3321
|
+
const adapter = await this.getAdapter();
|
|
3322
|
+
if (!adapter.insertArrowIPC) {
|
|
3323
|
+
throw new Error("This DuckDB adapter does not support Arrow IPC uploads.");
|
|
3324
|
+
}
|
|
3325
|
+
await adapter.insertArrowIPC(bytes, options);
|
|
3326
|
+
}
|
|
3316
3327
|
constructor(data, options, coreApi) {
|
|
3317
3328
|
super(data, options, DuckDBSQLSource.type, SQL_SOURCE_DEFAULT_OPTIONS, createDuckDBAdapter, coreApi);
|
|
3318
3329
|
}
|
|
@@ -3452,7 +3463,7 @@ async function createDuckDBBrowserAdapter(context) {
|
|
|
3452
3463
|
const connection = await database.connect();
|
|
3453
3464
|
const executeRows = async (sqlText, options = {}) => {
|
|
3454
3465
|
const result = await executeDuckDBBrowserQuery(connection, sqlText, options.parameters);
|
|
3455
|
-
return convertArrowToTable2(result, "object-row-table").data;
|
|
3466
|
+
return convertArrowToTable2((0, import_apache_arrow.tableFromIPC)(result), "object-row-table").data;
|
|
3456
3467
|
};
|
|
3457
3468
|
return {
|
|
3458
3469
|
capabilities: {
|
|
@@ -3461,6 +3472,13 @@ async function createDuckDBBrowserAdapter(context) {
|
|
|
3461
3472
|
runtime: "browser",
|
|
3462
3473
|
isDynamic: true
|
|
3463
3474
|
},
|
|
3475
|
+
async insertArrowIPC(bytes, options) {
|
|
3476
|
+
await connection.insertArrowFromIPCStream(new Uint8Array(bytes), {
|
|
3477
|
+
name: options.tableName,
|
|
3478
|
+
schema: options.schemaName,
|
|
3479
|
+
create: options.create ?? true
|
|
3480
|
+
});
|
|
3481
|
+
},
|
|
3464
3482
|
async connect() {
|
|
3465
3483
|
},
|
|
3466
3484
|
async close() {
|
|
@@ -3537,21 +3555,23 @@ async function createDuckDBBrowserAdapter(context) {
|
|
|
3537
3555
|
},
|
|
3538
3556
|
async executeArrow(sqlText, options = {}) {
|
|
3539
3557
|
const result = await executeDuckDBBrowserQuery(connection, sqlText, options.parameters);
|
|
3540
|
-
return convertArrowToTable2(result, "arrow-table");
|
|
3558
|
+
return convertArrowToTable2((0, import_apache_arrow.tableFromIPC)(result), "arrow-table");
|
|
3541
3559
|
}
|
|
3542
3560
|
};
|
|
3543
3561
|
}
|
|
3544
3562
|
async function executeDuckDBBrowserQuery(connection, sqlText, parameters) {
|
|
3545
|
-
|
|
3546
|
-
|
|
3547
|
-
|
|
3548
|
-
|
|
3549
|
-
|
|
3550
|
-
|
|
3551
|
-
|
|
3552
|
-
|
|
3553
|
-
|
|
3554
|
-
|
|
3563
|
+
return await connection.useUnsafe(async (bindings, connectionId) => {
|
|
3564
|
+
if (!parameters) {
|
|
3565
|
+
return await bindings.runQuery(connectionId, sqlText);
|
|
3566
|
+
}
|
|
3567
|
+
const values = Array.isArray(parameters) ? parameters : Object.values(parameters);
|
|
3568
|
+
const statementId = await bindings.createPrepared(connectionId, sqlText);
|
|
3569
|
+
try {
|
|
3570
|
+
return await bindings.runPrepared(connectionId, statementId, values);
|
|
3571
|
+
} finally {
|
|
3572
|
+
await bindings.closePrepared(connectionId, statementId);
|
|
3573
|
+
}
|
|
3574
|
+
});
|
|
3555
3575
|
}
|
|
3556
3576
|
function getDuckDBDatabasePath(url, options) {
|
|
3557
3577
|
var _a;
|
|
@@ -3567,7 +3587,7 @@ function getDuckDBDatabasePath(url, options) {
|
|
|
3567
3587
|
}
|
|
3568
3588
|
|
|
3569
3589
|
// dist/snowflake-sql-source.js
|
|
3570
|
-
var VERSION3 = true ? "5.0.0-alpha.
|
|
3590
|
+
var VERSION3 = true ? "5.0.0-alpha.14" : "latest";
|
|
3571
3591
|
var SnowflakeSQLSource = {
|
|
3572
3592
|
dataType: null,
|
|
3573
3593
|
batchType: null,
|