feat: duckdb-wasm query UI [DRAFT]
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
- [x] Validate whether this "query as you type" UI/UX is helpful or awful. I kind of like that there's no discrete Run Query button
- [x] Handle transient DB connection errors that seem to happen when switching tabs
- [x] Figure out a UI/UX for toggling between the
flat-uicomponent and the query interface - [x] Hook up the
flat-uicomponent to the results section of the query interface so that we can better visualize results - [ ] Make the code editor better (more robust column name and type detection)
@jaked Great questions! I can answer a few of these for you.
There are in fact docs for installing the library in a vite environment and they simply did not work for me. I ran into weird, esoteric issues that you can reproduce by following the steps in the linked README.
As for the CDN approach, this is one option. The drawback is that jsdelivr doesn't seem to like connections from localhost:3000, so I couldn't load the bundles that way.
EDIT: this is fixed in 99055d6. Turns out we were using an outdated version of vite which didn't seem to like the URL imports.
cc @ankoh of @duckdb in case the DuckDB team are interested in tracking this feature
@jaked Great questions! I can answer a few of these for you.
There are in fact docs for installing the library in a
viteenvironment and they simply did not work for me. I ran into weird, esoteric issues that you can reproduce by following the steps in the linked README.As for the CDN approach, this is one option. The drawback is that
jsdelivrdoesn't seem to like connections fromlocalhost:3000, so I couldn't load the bundles that way.
Maybe I can help here. DuckDB-Wasm only requires to treat our WebAssembly modules as plain binary assets. Bundling from npm should be more convenient for future updates.
This PR is exciting! :rocket:
This is wonderful feedback @LoneRifle and @ankoh, thank you both.
Stay tuned as we work through these updates 😎
Looks very exciting.