@gscdump/engine-duckdb-wasm 2.1.0 → 2.1.1
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.
|
@@ -4,10 +4,14 @@ async function createClient(db, conn) {
|
|
|
4
4
|
db,
|
|
5
5
|
conn,
|
|
6
6
|
async query(sql, params = []) {
|
|
7
|
-
if (params.length === 0)
|
|
7
|
+
if (params.length === 0) {
|
|
8
|
+
const res = await conn.query(sql);
|
|
9
|
+
return arrowToRows(res);
|
|
10
|
+
}
|
|
8
11
|
const stmt = await conn.prepare(sql);
|
|
9
12
|
try {
|
|
10
|
-
|
|
13
|
+
const res = await stmt.query(...params);
|
|
14
|
+
return arrowToRows(res);
|
|
11
15
|
} finally {
|
|
12
16
|
await stmt.close();
|
|
13
17
|
}
|
package/dist/runtime.mjs
CHANGED
|
@@ -6,7 +6,7 @@ import { sqlEscape } from "@gscdump/engine/sql";
|
|
|
6
6
|
import { err, ok, unwrapResult } from "gscdump/result";
|
|
7
7
|
const DEFAULT_ATTACH_FETCH_CONCURRENCY = 2;
|
|
8
8
|
const DEFAULT_ATTACH_MAX_FILES = 32;
|
|
9
|
-
const DEFAULT_ATTACH_MAX_BYTES =
|
|
9
|
+
const DEFAULT_ATTACH_MAX_BYTES = 16777216;
|
|
10
10
|
let nextAttachId = 0;
|
|
11
11
|
var BrowserAttachBudgetExceededError = class extends Error {
|
|
12
12
|
name = "BrowserAttachBudgetExceededError";
|
|
@@ -385,8 +385,9 @@ function createBrowserAnalysisRuntime(boot, options = {}) {
|
|
|
385
385
|
conn,
|
|
386
386
|
async query(sql, params, signal) {
|
|
387
387
|
const t0 = performance.now();
|
|
388
|
+
const result = await runExclusive(signal, () => runParameterizedDirect(sql, params, signal));
|
|
388
389
|
return {
|
|
389
|
-
rows: arrowToRows(
|
|
390
|
+
rows: arrowToRows(result),
|
|
390
391
|
queryMs: performance.now() - t0
|
|
391
392
|
};
|
|
392
393
|
},
|
|
@@ -395,14 +396,15 @@ function createBrowserAnalysisRuntime(boot, options = {}) {
|
|
|
395
396
|
const run = async () => {
|
|
396
397
|
signal?.throwIfAborted();
|
|
397
398
|
const t0 = performance.now();
|
|
398
|
-
const
|
|
399
|
+
const source = createAttachedTableSource({ query: async (sql, bindParams, innerSignal) => {
|
|
399
400
|
return arrowToRows(await runParameterizedDirect(sql, bindParams, innerSignal ?? signal));
|
|
400
401
|
} }, {
|
|
401
402
|
schema,
|
|
402
403
|
signal,
|
|
403
404
|
attachedTables,
|
|
404
405
|
adapter: pgResolverAdapter
|
|
405
|
-
})
|
|
406
|
+
});
|
|
407
|
+
const result = await runAnalyzerFromSource(source, params, registry);
|
|
406
408
|
return {
|
|
407
409
|
results: result.results,
|
|
408
410
|
meta: result.meta,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gscdump/engine-duckdb-wasm",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "2.1.
|
|
4
|
+
"version": "2.1.1",
|
|
5
5
|
"description": "DuckDB-WASM engine adapter for @gscdump/analysis — typed browser analytics against parquet via R2.",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "Harlan Wilton",
|
|
@@ -45,9 +45,9 @@
|
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
47
|
"drizzle-orm": "1.0.0-rc.4",
|
|
48
|
-
"@gscdump/contracts": "^2.1.
|
|
49
|
-
"@gscdump/engine": "^2.1.
|
|
50
|
-
"gscdump": "^2.1.
|
|
48
|
+
"@gscdump/contracts": "^2.1.1",
|
|
49
|
+
"@gscdump/engine": "^2.1.1",
|
|
50
|
+
"gscdump": "^2.1.1"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
53
|
"@duckdb/duckdb-wasm": "1.33.1-dev57.0",
|