flat-viewer icon indicating copy to clipboard operation
flat-viewer copied to clipboard

feat: duckdb-wasm query UI [DRAFT]

Open mattrothenberg opened this issue 3 years ago • 5 comments

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.

Screen Shot 2022-05-12 at 2 39 40 PM

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-ui component and the query interface
  • [x] Hook up the flat-ui component 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)

mattrothenberg avatar May 12 '22 17:05 mattrothenberg

@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.

mattrothenberg avatar May 12 '22 17:05 mattrothenberg

cc @ankoh of @duckdb in case the DuckDB team are interested in tracking this feature

LoneRifle avatar May 16 '22 08:05 LoneRifle

@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.

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:

ankoh avatar May 16 '22 09:05 ankoh

This is wonderful feedback @LoneRifle and @ankoh, thank you both.

Stay tuned as we work through these updates 😎

mattrothenberg avatar May 16 '22 11:05 mattrothenberg

Looks very exciting.

domoritz avatar May 16 '22 14:05 domoritz