dbcodeio / public

The Power of Databases, The Convenience of VS Code: All in One Place
29 stars 1 forks source link

Refresh button not always enabled #29

Closed devpkr1 closed 1 month ago

devpkr1 commented 1 month ago

Hi DB Code Team,

The refresh button in Output Toolbar is not working correctly , actually it takes infinite time instead of refreshing the output. I am attaching screen recording , please resolve it.

https://github.com/user-attachments/assets/cf99d15c-e153-49bc-b839-355fda194cd5

mikeburgh commented 1 month ago

if you can reproduce this, can you go to the help menu and toggle the developer tools option, and in the console see if there is any errors ?

Also, does it work when the data is not pivoted/grouped ?

devpkr1 commented 1 month ago

It is not working either the data is pivoted or not pivoted . I am attaching the screenshot of Developers tools console, for your reference. Screenshot 2024-10-03 213921

mikeburgh commented 1 month ago

Yeah it's not logging or throwing any errors.. and I have tried a number of different ways to try and get it to happen but cannot.

Can you try cutting down the query you are using till you find what in the query might be causing it ? or share the query and I can try and replicate it on my end..

devpkr1 commented 1 month ago

I tried Refresh button with simplest query but its not working. But one thing i have noted that is when try to open any table from connections pane directly then it opens in new tab and their Refresh button is working perfectly.

Screenshot attached:-

Screenshot 2024-10-04 081837 Screenshot 2024-10-04 082657

Thanks Pradeep Kumar

mikeburgh commented 1 month ago

Thanks..

The refresh button will only be active when we can be sure we "know" the query... and we do that by parsing it.

So in the case of the CTE, we have not build the parser up enough yet to understand CTE's.. and so it does not understand the query, and hence doesn't offer refresh (or editing).

When you load from the explorer, we know the query (it's simple selects) so hence refresh and edit work.

We are building out more of the parser, and I might look into an edge case that allows refresh if the query only returns a single result set as a stop gap solution until the parser is better.

devpkr1 commented 1 month ago

Yes, the refresh button is not working , it takes infinite time for just a simple "select" statement and this happens only in DB Code Notebook not in SQL file as I shown in the first screenshot.

I am again attaching the screen recording for your reference.

https://github.com/user-attachments/assets/c285263e-9ffb-4209-8463-d9ff21d7b905

Please resolve this issue , i think this is the bug because in sql script file output refresh button is working but in notebook it is not working.

Thanks and regards, Pradeep Kumar

mikeburgh commented 1 month ago

Sorry my bad, totally missed in your screenshots/video you were in the notebooks!

Will get it fixed

mikeburgh commented 1 month ago

Just pushed a pre release.. Should fix this now.. Edit was also not working in notebooks.

devpkr1 commented 1 month ago

Hi mike,

Refresh button issue is fixed now , but "open in editor" option in query output cell , i can't understand the use of this.

Thanks and Regards, Pradeep Kumar

mikeburgh commented 1 month ago

Open in editor is the first part of a feature that allows you to open the cell contents in the editor, and if editing the data is supported, you can change it in the editor and it will then update back in the results, so when you hit save the changes persist to the database.

I just need to do the second part, tracking the file that gets opened in the editor, and then writing the content back into the grid.

But I think we can close this now as the refresh issue is fixed (still doesn't always appear as enabled, but when it does it will work)

mikeburgh commented 1 month ago

Of course, re open if you think otherwise