Back
Version 12
1/10/2025
async function createWorker(url: string) {
const workerScript = await fetch("https://maxm-exaltedamberkiwi.web.val.run");
const workerURL = URL.createObjectURL(await workerScript.blob());
return new Worker(workerURL, { type: "module" });
}
import duckdb from "npm:@duckdb/duckdb-wasm@1.17.0";
const bundles = duckdb.getJsDelivrBundles();
const bundle = await duckdb.selectBundle(bundles);
const logger = new duckdb.ConsoleLogger();
const worker = await createWorker(bundle.mainWorker);
const db = new duckdb.AsyncDuckDB(logger, worker);
await db.instantiate(bundle.mainModule);
console.log(db);
Updated: January 10, 2025