vscode-db2i icon indicating copy to clipboard operation
vscode-db2i copied to clipboard

preview resultsets with Preview Data extension

Open ajshedivy opened this issue 8 months ago • 0 comments

Putting this here to see if this is a good idea or not.

Idea

Add a preview statement qualifier that can open up the result set using the Data Preview extension: https://marketplace.visualstudio.com/items?itemName=RandomFractalsInc.vscode-data-preview

example:

preview: select * from sample.employee

This will automatically open a new Data Preview session for the result set In order to do further sorting, slicing, and charting.

Demo

https://github.com/codefori/vscode-db2i/assets/50843283/c5fc46d3-96f4-44b3-9fd5-19bf16ed018b

Split by column

image

Group by with metric

image

Charting with custom group by, metic=avg

image

TODO

  • to use Data Preview, a file with an extension like .json must be opened. My workaround in the demo is to save the resultset as json in the Temp directory.
  • remove temp json files on system disconnect
  • handle error cases

ajshedivy avatar Jun 19 '24 23:06 ajshedivy