Skip to content

Commit

Permalink
Update src/duckdb.ts
Browse files Browse the repository at this point in the history
Co-authored-by: Mike Bostock <[email protected]>
  • Loading branch information
Fil and mbostock authored Oct 20, 2024
1 parent 6764969 commit d72f0c3
Showing 1 changed file with 0 additions and 33 deletions.
33 changes: 0 additions & 33 deletions src/duckdb.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,36 +62,3 @@ export async function resolveDuckDBExtension(root: string, p: string, repo: stri
downloadRequests.set(cachePath, promise);
return promise;
}

/*
promise = Promise.all(
bundles.map(async (p) => {
const outputPath = join(outputDir, `${name}.${p}.wasm`);
console.log(`download: ${href} ${faint("→")} ${outputPath}`);
const response = await fetch(href);
if (!response.ok) throw new Error(`unable to fetch: ${href}`);
await mkdir(dirname(outputPath), {recursive: true});
await writeFile(outputPath, Buffer.from(await response.arrayBuffer()));
})
).then(async () => {
const ref = await duckDBHash(name, files);
for (const [i, p] of bundles.entries()) {
const targetPath = join(cache, ref, "v1.1.1", `wasm_${p}`, `${name}.duckdb_extension.wasm`);
await mkdir(dirname(targetPath), {recursive: true});
await copyFile(files[i], targetPath);
}
return ref;
});
promise.catch(console.error).then(() => files.forEach((file) => downloadRequests.delete(file)));
downloadRequests.set(key, promise);
return promise;
}
async function duckDBHash(name: string, files: string[]): Promise<string> {
const hash = createHash("sha256");
hash.update(name);
for (const file of files) hash.update(await readFile(file, "utf-8"));
return join("_duckdb", `${name}-${hash.digest("hex").slice(0, 8)}`);
}
*/

0 comments on commit d72f0c3

Please sign in to comment.