-
Notifications
You must be signed in to change notification settings - Fork 17
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
feat: duckdb-wasm query UI [DRAFT] #39
base: main
Are you sure you want to change the base?
Conversation
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.
really cool!
I don't totally get why it's necessary to include all the duckdb code explicitly in public
. I wonder if there is a way to pass through the contents of a package somehow in the build (so use the code in the duckdb
package dep instead of duplicating it explicitly); access it via the built code instead of via HTTP (probably hard to do with WASM); or maybe to point to the code on a CDN instead.
I get that this a spike, none of this is criticism, just curiosity.
@jaked Great questions! I can answer a few of these for you. There are in fact docs for installing the library in a As for the CDN approach, this is one option. The drawback is that EDIT: this is fixed in 99055d6. Turns out we were using an outdated version of |
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.
@mattrothenberg, thanks for giving me the chance to look at this first cut of the feature, it looks really promising!
Query as you type is very helpful, and the debounce seems to be tuned just nice.
Couple of specific things that I'll comment in the appropriate file locations
Maybe I can help here. This PR is exciting! 🚀 |
Co-authored-by: LoneRifle <[email protected]>
This is wonderful feedback @LoneRifle and @ankoh, thank you both. Stay tuned as we work through these updates 😎 |
const execQuery = async (query: string) => { | ||
if (!connectionRef.current) return; | ||
const queryRes = await connectionRef.current.query(query); | ||
const asArray = queryRes.toArray(); |
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.
You don't need to convert the result to an array. Arrow tables already behave like arrays of objects if you iterate over them for for
.
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.
@domoritz Fantastic! This felt kludgy and I suspected there was a better way.
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.
map
and forEach
won't work so you may have to refactor your code a bit but it would be worth it since you avoid a lot of upfront conversion.
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.
@domoritz Good call. We're ultimately passing this data down to our flat-ui
component , so it needs to be in a shape that this component understands (or we need to refactor the component)
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.
You may need to refactor the component. Shouldn't be a big deal, though, and would be great for interoperability anyway.
Looks very exciting. |
This PR is a rough pass at #38, providing an interface for querying the current dataset via
duckdb-wasm
. cc @LoneRifle, I welcome any and all thoughts you may have here.Todos
flat-ui
component and the query interfaceflat-ui
component to the results section of the query interface so that we can better visualize results