Skip to content

@duckdb/duckdb-wasm 1.24 #356

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Mar 3, 2023
Merged

@duckdb/duckdb-wasm 1.24 #356

merged 7 commits into from
Mar 3, 2023

Conversation

mbostock
Copy link
Member

@mbostock mbostock commented Mar 3, 2023

Supersedes #350.

@mbostock mbostock mentioned this pull request Mar 3, 2023
@mbostock mbostock merged commit 89f2700 into main Mar 3, 2023
@mbostock mbostock deleted the mbostock/duckdb-1.24 branch March 3, 2023 17:34
@@ -169,7 +171,7 @@ async function insertFile(database, name, file, options) {
const buffer = await file.arrayBuffer();
await database.registerFileBuffer(file.name, new Uint8Array(buffer));
} else {
await database.registerFileURL(file.name, url, duckdb.DuckDBDataProtocol.HTTP);
await database.registerFileURL(file.name, url, 4); // duckdb.DuckDBDataProtocol.HTTP
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could be an issue if the enum ever changes.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. Something to check when we upgrade.

Copy link
Contributor

@domoritz domoritz Mar 3, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the reason not to use the value from the DuckDB lib?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just plumbing. The duckdb module isn’t available globally; it’s loaded in loadDuckDB here:

const module = await import(`${cdn}${duckdb.resolve()}`);

So, I’d need to call loadDuckDB again here, or I’d need to somehow pass it through the call to createDuckDB above and then pass it down into insertFile.

const db = await createDuckDB();

await insertFile(db, name, source);

All of those felt like a lot more work than typing the number 4.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants