@malloydata/db-duckdb 0.0.402 → 0.0.404
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.
|
@@ -231,7 +231,7 @@ function unwrapRow(row, schema) {
|
|
|
231
231
|
function unwrapTable(table) {
|
|
232
232
|
return table.toArray().map(row => unwrapRow(row, table.schema));
|
|
233
233
|
}
|
|
234
|
-
const isNode = () => typeof
|
|
234
|
+
const isNode = () => { var _a; return typeof process !== 'undefined' && typeof ((_a = process.versions) === null || _a === void 0 ? void 0 : _a.node) === 'string'; };
|
|
235
235
|
class DuckDBWASMConnection extends duckdb_common_1.DuckDBCommon {
|
|
236
236
|
constructor(arg, arg2, workingDirectory, queryOptions) {
|
|
237
237
|
var _a, _b;
|
|
@@ -297,8 +297,12 @@ class DuckDBWASMConnection extends duckdb_common_1.DuckDBCommon {
|
|
|
297
297
|
: URL.createObjectURL(new Blob([`importScripts("${bundle.mainWorker}");`], {
|
|
298
298
|
type: 'text/javascript',
|
|
299
299
|
}));
|
|
300
|
-
// Instantiate the asynchronous version of DuckDB-wasm
|
|
301
|
-
|
|
300
|
+
// Instantiate the asynchronous version of DuckDB-wasm. Under Node the
|
|
301
|
+
// worker bundle is a CommonJS module, so load it as a module worker;
|
|
302
|
+
// web-worker's classic-script path runs it without a module scope.
|
|
303
|
+
this.worker = isNode()
|
|
304
|
+
? new web_worker_1.default(workerUrl, { type: 'module' })
|
|
305
|
+
: new web_worker_1.default(workerUrl);
|
|
302
306
|
const logger = new duckdb.VoidLogger();
|
|
303
307
|
this._database = new duckdb.AsyncDuckDB(logger, this.worker);
|
|
304
308
|
await this._database.instantiate(bundle.mainModule, bundle.pthreadWorker);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@malloydata/db-duckdb",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.404",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -59,11 +59,11 @@
|
|
|
59
59
|
"prepublishOnly": "npm run build"
|
|
60
60
|
},
|
|
61
61
|
"dependencies": {
|
|
62
|
-
"@duckdb/duckdb-wasm": "1.33.1-
|
|
63
|
-
"@duckdb/node-api": "1.
|
|
64
|
-
"@malloydata/malloy": "0.0.
|
|
62
|
+
"@duckdb/duckdb-wasm": "1.33.1-dev45.0",
|
|
63
|
+
"@duckdb/node-api": "1.5.3-r.2",
|
|
64
|
+
"@malloydata/malloy": "0.0.404",
|
|
65
65
|
"@motherduck/wasm-client": "^0.6.6",
|
|
66
66
|
"apache-arrow": "^17.0.0",
|
|
67
|
-
"web-worker": "^1.
|
|
67
|
+
"web-worker": "^1.5.0"
|
|
68
68
|
}
|
|
69
69
|
}
|