mtxr / SublimeText-SQLTools

SQLTools for Sublime Text 3
https://code.mteixeira.dev/SublimeText-SQLTools/
GNU General Public License v3.0
177 stars 40 forks source link

Bug: List and Open Saved Queries executes the query if not connected to a database prior #125

Closed Coteh closed 7 years ago

Coteh commented 7 years ago

Issue Type

Prerequisites (For bugfixes)

Description

Found this weird oddity with how the List and Open Saved Queries command works. If I'm not connected to a database (ex. I just opened up Sublime Text) and I run the command, and after selecting my database in the dropdown, it will actually execute the query instead of open a new tab containing the query. However, all subsequent queries I open with List and Open Saved Queries will open the query in a new tab properly without executing it. I presume this is because I'm already logged in and thus doesn't do that extra measure anymore which may contain a call to execute query instead of open it. I can self-assign to this issue and look into it further if you guys like. :)

Steps to Reproduce (For bugfixes)

  1. (Close and re-)Open Sublime Text
  2. Select "ST: List and Open Saved Queries" or press Ctrl-E, Ctrl-O if using default keybinds
  3. Select database connection
  4. Select saved query from dropdown

Expected behavior: Query is opened in a new tab

Actual behavior: Query is executed

Versions

tkopets commented 7 years ago

Indeed this is a bug, I've just reproduced it - thanks for spotting it. The fix should be relatively simple, so I'll fix it right away.

tkopets commented 7 years ago

Since we actually don't need the connection at all if we are just opening the saved query contents the proposal is not to show list of Connections at all. (will be implemented as part of this bug fix)