I have a file, let’s say, working.sql.
I want to do some work on my code until I’m happy with it.
And now I want to connect to a database, and execute it…but I don’t want my fingers to leave the keyboard.
Of course, you’ll need the SQL Developer extension in addition to VS Code.
Demo: Look ma, no mouse!
I’m hitting on my Mac, option+command+Z to select a connection, followed by fn+F9 to execute the query.
Oh, I also had to use the arrow keys and the Return key to choose the connection I wanted.
That looks like this –
How to make it work
In VS Code, pull up the Keyboard Shortcuts dialog.
Then search on ‘connect’ – and look for this –
Click the ‘pencil’ icon, and then assign a keyboard combo. option+command+Z was unused, so I grabbed it.
And that’s it!