csjh
csjh11mo ago

DuckDB deno package broken & npm package segfaulting

Has anyone had any luck using DuckDB with Deno? I've tried with the npm package with segfaults on a basic test query, and with the denoland package with fails on initialization (which is especially unfortunate because it was made by one of the deno maintainers? oh well).
4 Replies
divy
divy11mo ago
the one on /x should work. What’s the initialisation error?
csjh
csjh11mo ago
my bad, query error not initialization but it's
error: Uncaught (in promise) TypeError: Cannot convert object to primitive value
const view = new Deno.UnsafePointerView(BigInt(v));
^
at BigInt (<anonymous>)
at toArrayBuffer (https://deno.land/x/duckdb@0.1.1/lib.js:7:43)
at Module.query (https://deno.land/x/duckdb@0.1.1/lib.js:530:7)
at Connection.query (https://deno.land/x/duckdb@0.1.1/mod.ts:38:16)
at file:///Users/csjh/Test/duckdb-querying/main.ts:8:24
at eventLoopTick (ext:core/01_core.js:183:11)
error: Uncaught (in promise) TypeError: Cannot convert object to primitive value
const view = new Deno.UnsafePointerView(BigInt(v));
^
at BigInt (<anonymous>)
at toArrayBuffer (https://deno.land/x/duckdb@0.1.1/lib.js:7:43)
at Module.query (https://deno.land/x/duckdb@0.1.1/lib.js:530:7)
at Connection.query (https://deno.land/x/duckdb@0.1.1/mod.ts:38:16)
at file:///Users/csjh/Test/duckdb-querying/main.ts:8:24
at eventLoopTick (ext:core/01_core.js:183:11)
repro:
import { open } from "https://deno.land/x/duckdb@0.1.1/mod.ts";

const db = open(":memory:");


const connection = db.connect();

connection.query('select 1');
import { open } from "https://deno.land/x/duckdb@0.1.1/mod.ts";

const db = open(":memory:");


const connection = db.connect();

connection.query('select 1');
ran w/ deno run --allow-all --unstable main.ts appears there's a PR open on the repo as well
divy
divy11mo ago
oh ok, will land it
csjh
csjh11mo ago
thanks 🙂