-
Notifications
You must be signed in to change notification settings - Fork 84
@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
Conversation
@@ -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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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:
Line 256 in 89f2700
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
.
Line 127 in 89f2700
const db = await createDuckDB(); |
Line 138 in 89f2700
await insertFile(db, name, source); |
All of those felt like a lot more work than typing the number 4
.
Supersedes #350.