codefori / codefori/vscode-db2i

preview resultsets with Preview Data extension

Open
#241 0 comments 1 reaction 1 assignee Claimed by @worksofliam View on GitHub
enhancement
Dominant language
TypeScript
Stars
76
Forks
54
Avg merge
17m
Merged PRs (30d)
1

Description

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:
```sql
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](https://github.com/codefori/vscode-db2i/assets/50843283/28e8f78f-a643-4296-9bcb-05aa4aad3d8a)

### Group by with metric
![image](https://github.com/codefori/vscode-db2i/assets/50843283/39361f7f-62a3-455c-9b0a-fff9ee01f3eb)

### Charting with custom group by, metic=avg
![image](https://github.com/codefori/vscode-db2i/assets/50843283/74a4b12a-fae7-4702-a702-160481fe400b)

## 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

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.