Readme

DuckDB

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 });
  }
Val Town is a social website to write and deploy JavaScript.
Build APIs and schedule functions from your browser.
Comments
Nobody has commented on this val yet: be the first!
September 2, 2024