microsoft / azuredatastudio

Azure Data Studio is a data management and development tool with connectivity to popular cloud and on-premises databases. Azure Data Studio supports Windows, macOS, and Linux, with immediate capability to connect to Azure SQL and SQL Server. Browse the extension library for more database support options including MySQL, PostgreSQL, and MongoDB.
https://learn.microsoft.com/sql/azure-data-studio
MIT License
7.55k stars 900 forks source link

[Feature Request] Keybinding Property for Connect/Change Connection in SQL Query Editor #1187

Open drewwalters opened 6 years ago

drewwalters commented 6 years ago

As a User, I want to change my editor's database connection from the keyboard so that I can establish a connection before running a script, and/or change my connection without leaving the keyboard.

This feature would be similar to the workbench.action.editor.changeLanguageMode property. There are already "Connect" and "Change Connection" buttons in the SQL Query editor, ideally the property would extend use those functions through the following scenarios:

  1. If the editor does not have a database connection established, open Recent Connections
  2. If a database connection does exist, open the Recent Connections pane. (The same as the current results of clicking "Change Connection." Currently, if a user selects "Change Connection" and then cancels esc the Recent Connections pane, the connection is terminated. This is preferred over linking scenario 2 to disconnect.)
Bikonja commented 6 years ago

For simply changing database within the same server I'd love to have a command in the palette / a keyboard shortcut to just open up the Change database dropdown menu so I can select a different database and continue my work instead of mucking about with the connection window just to switch to a different db within the same server. Obviously, switching to a different server is still a desirable action from the keyboard / command palette, but if you're just switching within the same server it's still a time waster.

dzsquared commented 5 years ago

For anyone who comes across this before it's completed in Azure Data Studio and finds themselves regularly hitting ctrl+U, here's an extension for quickly changing the database of a query editor connection.

https://github.com/dzsquared/sqlops-usedatabase

aharpervc commented 1 year ago

For anyone who comes across this before it's completed in Azure Data Studio and finds themselves regularly hitting ctrl+U, here's an extension for quickly changing the database of a query editor connection.

https://github.com/dzsquared/sqlops-usedatabase

@dzsquared this link is a 404, do you have an updated link for this extension?

dzsquared commented 1 year ago

@aharpervc - I ended up rolling it into Query Editor Boost - https://github.com/dzsquared/query-editor-boost

(standard disclaimer - while I work for Microsoft at this time, my work on Query Editor Boost is as a 3rd party)

drewwalters commented 1 year ago

@dzsquared Thank you for the great extension! This has been the best option thus far.

However - the issue shouldn't be closed until it's a native feature in ADS.

dzsquared commented 1 year ago

@drewwalters - to be clear, I'm not advocating that this issue get closed. I'm responding to the question from @aharpervc about where the workaround extension is now available.

josefranciscorm commented 1 year ago

This is actually the main reason why I changed to Datagrip over ADS. SSMS has a way to do this, it would be great if they could finally add this. Even VS Code with the MSSQL extension allows you to change the connection with a command which then shows a list of connections.

jsteinbergTCALLC commented 1 year ago

I have just installed ADS (1.46) , and as far as I can tell, there is absolutely no way to change the current connection using the keyboard. Switching servers is something I do with great frequency, and it is an huge annoyance to no be able to use the keyboard for this basic function. [Edited - changed "Switching Databases" to "Switching Servers"]

NightBound56 commented 11 months ago

This issue is stopping me from Migrating to ADS too.