minodisk / bigquery-runner

An extension to query BigQuery directly and view the results in VSCode.
https://marketplace.visualstudio.com/items?itemName=minodisk.bigquery-runner
Apache License 2.0
44 stars 8 forks source link

How to download the results table? #16

Closed umernalla closed 2 years ago

umernalla commented 2 years ago

Hi, Thanks for writing this great extension. Can you advise how I can download/save the results to a file? I thought I saw something in the Extension settings earlier - where I could change the output to a file. But the extension was changed and I had to reload it - and now I cannot see the same setting? I tried restarting VS Code - but I still cannot see it. Thanks.

minodisk commented 2 years ago

@umernalla Thanks for asking the question 😉

I added a download button to the viewer in v1.0.0. If you want to save a table to a file, you can do so from the viewer's download button. I have also added some options to the download process.

I also removed the output destination option because it would make the code too complicated. CHANGELOG.md | v1.0.0

I believe the flow of viewing the table results in the viewer and then downloading satisfies most of the use cases. However, if you must output directly to a file, please let me know the specific use case 👍

無題

umernalla commented 2 years ago

Hi @minodisk Thanks for the prompt reply. Sorry for the silly question, I did not notice the download button. However, when I try to download it, there is no file created. I tried several different formats - CSV, MD and plain text and also tried saving in various folders. I also tried to create the blank file first and then select the file for output - same - nothing is written to disk. The VS Code output window certainly shows progress e.g. [downloader] [markdown] start downloading to /C:/Temp/test.md [downloader] [markdown] job created [downloader] [markdown] table fetched [downloader] [markdown] flat created SecondsAgg, UpdateCount [downloader] [markdown] writing head [downloader] [markdown] writing body [downloader] [markdown] fetched 10000 rows [downloader] [markdown] page 1 - 10000 [downloader] [markdown] written 10000 rows [downloader] [markdown] fetched 10000 rows [downloader] [markdown] page 10001 - 20000 [downloader] [markdown] written 10000 rows [downloader] [markdown] fetched 10000 rows [downloader] [markdown] page 20001 - 30000 [downloader] [markdown] written 10000 rows [downloader] [markdown] fetched 7954 rows [downloader] [markdown] page 30001 - 37954 [downloader] [markdown] written 7954 rows [downloader] [markdown] writing foot [downloader] [markdown] complete But there is no file present once complete. I also got a colleague to try the same on his PC and he also confirms that no file is written?

minodisk commented 2 years ago

@umernalla I didn't check it on Windows OS, I'll check it when I'm free 🪟

minodisk commented 2 years ago

Reproduced.

image

minodisk commented 2 years ago

@umernalla I fixed it in v1.1.1, try it. image

umernalla commented 2 years ago

@minodisk Thank you for the prompt fix. I just tested a CSV file and MD file and they worked!

minodisk commented 2 years ago

Now we can download with command in v1.6.0

20

minodisk commented 2 years ago

We can now see the download progress in v1.10.0.

19