DuckDB works on Val Town, with only one small tweak! We're basically using DuckDB in the same way you'd use it with a browser - using the WASM package with its dependencies fetched from jsdelivr.
The only trick is to create the worker ourselves rather than using duckdb.createWorker
. DuckDB's built-in createWorker method doesn't specify a worker type, which causes type
to default to classic
, and Deno (our runtime) doesn't support classic workers.
Note: A small check was added to make this compatible with local Deno.
if (typeof Deno !== "undefined") {
return new Worker(url, { type: "module", deno: true });
}