I closed Azure Data Studio (ADS) with a blank query tab open. When I restarted the app the blank query tab opened with it. I wrote a query in the tab then realised there appears to be no way to set the connection. Is there a way to connect this tab to a database?
The previously unsaved query tab reopens without a hotbar at the top of the window (the hotbar being the menu with Run, Connect, etc buttons):
Right-clicking on the tab doesn't offer any way to connect that I can see:
In contrast, tabs that were previously saved before closing ADS reopen showing the hotbar:
And tabs opened since ADS was restarted, which are still unsaved, also show the hotbar:
So it's only unsaved tabs present when ADS restarts that don't show the hotbar.
Am I missing something? Is there a way to connect this unsaved tab to a database? Or is the only option to open another query tab and copy the query I wrote to the new tab?
The only way I managed to get the Connect and other controls to display at the top of the old window was to save it as a .sql file. Once saved the appropriate controls became visible at the top of the window.
I guess that Azure Data Studio must use the file extension of a window to determine if it's a SQL window or not, at least when it opens an old, unsaved, window from the previous session.
When reopened the window retained the previous title it had before it was closed: "SQLQuery_1", without a file extension. When the window was created in the previous session Azure Data Studio had recognised it as a SQL window, and had displayed the Connect and other controls at the top. But when it was reopened after Azure Data Studio restarted it looks like Azure Data Studio no longer recognised it as a SQL window, presumably because it had no file extension.