Run Query Only Selected Text

renerlemes's profile image renerlemes posted 10 years ago in Running SQL scripts Permalink
One suggestion would be the ability to execute the query if I selected the text, as is possible in other software to query the database.
kalvaro's profile image kalvaro posted 10 years ago Permalink
renerlemes's profile image renerlemes posted 10 years ago Permalink
I explain wrong. My suggestion is two shortcut for same function as Run Selected Query and Run (F9 and CTRL + F9)
kalvaro's profile image kalvaro posted 10 years ago Permalink
Sorry: I can't understand a word.
renerlemes's profile image renerlemes posted 10 years ago Permalink
My suggestion is to use the same shortcut for 2 functions. One would be selected and run with the same shortcut to run all queries query. For example, if I hit F9 and have selected text, this text will run, if you have nothing selected, will run everything.
kalvaro's profile image kalvaro posted 10 years ago Permalink
So it has nothing to do with shortcuts or implementing new run modes. You'd like HeidiSQL to pick "Run Selection" automatically when there is a selection.

IMHO, it looks pretty interesting. I know nothing about HeidiSQL guts (I'm not a developer) but perhaps it could be implemented by keeping current commands internally:

- Run all
- Run selection
- Run current query

... and exposing them this way:

- Run -> chooses automatically between "Run all" or "Run selection"
- Run current -> chooses automatically between "Run current query" or "Run selection"

It's a subtle but potentially confusing change so further feedback and analysis would be required.

(If I still don't understand your request, please feel free to add more clarifications but I love the feature I've described nonetheless).
renerlemes's profile image renerlemes posted 10 years ago Permalink
Really you understood my request. It's a pretty cool feature. Can we explain this feature for a developer? I'm new to the forum.
kalvaro's profile image kalvaro posted 10 years ago Permalink
Anse hangs around almost daily. But, in my experience, this kind of changes really benefit from extended user feedback.
ansgar's profile image ansgar posted 10 years ago Permalink
Using different shortcuts is more explicit and less confusing I think. Using the same shortcut in conjunction with having text selected can especially confuse new users. I can't see a real benefit in having the same shortcut for both actions, is there some?
renerlemes's profile image renerlemes posted 10 years ago Permalink
Most managers database like MySQL Query Browser and SQLManagement Studio there is this native function so it would not mess. Would be more convenient and fast if it had this feature in my opinion. An example, in my company has 26 programmers, all stopped using the SQLManagement Studio, however, we made giving the excellent application and the only problem we have is that shortcut. My only suggestion would be that you can use the same shortcut key and run the two functions.
ghoppermaster's profile image ghoppermaster posted 8 years ago Permalink

Hi,

Firstly thanks for great software!

Has this been implemented as yet?

I feel it's really essential to have the same shortcut to run highlighted and non-highlighted queries. It's must more intuitive and really speeds up the development process.

Would be happy to donate for this feature as I run into it all day and it really impacts my workflow.

Thanks again! :)

[expired user #9462]'s profile image [expired user #9462] posted 8 years ago Permalink

I would like to second this feature.

Coming from SSMS, it automatically detects if there is selected SQL and runs JUST the selected portion. If nothing else, put a checkbox to allow the user to decide if it should auto-execute the selected text or force the user to press CTRL-F9.

I would also like to see if we can map the "Execute" key. SSMS uses F5 to refresh, and I find myself hitting F9 when I switch back and forth.

ansgar's profile image ansgar posted 8 years ago Permalink

Coming from SSMS, it automatically detects if there is selected SQL and runs JUST the selected portion. If nothing else, put a checkbox to allow the user to decide if it should auto-execute the selected text or force the user to press CTRL-F9.

Sorry, I see there are quite some users asking for this. Only I'm still thinking that having different shortcuts for different actions is more clear and more easy to understand in terms of usability. Having the same shortcut doing two different things dependingly on a text selection sounds non-intuitive.

I would also like to see if we can map the "Execute" key. SSMS uses F5 to refresh, and I find myself hitting F9 when I switch back and forth.

You can customize your keyboard shortcuts in HeidiSQL: Tools > Preferences > Shortcuts .

renerlemes's profile image renerlemes posted 8 years ago Permalink

If multiple users are requesting this option is why it is important and also used in several other tools and works well. This could be an exception shortcuts.

[expired user #9462]'s profile image [expired user #9462] posted 8 years ago Permalink

Having the same shortcut doing two different things dependingly on a text selection sounds non-intuitive.

I disagree... it is un-intuitive that the selected portion does NOT run because that is how almost all other query tools work. You could certainly create a checkbox that is un-checked by default, but allow those of us that want this functionality to check it.

You can customize your keyboard shortcuts in HeidiSQL: Tools > Preferences > Shortcuts .

Awesome! Thanks!

renerlemes's profile image renerlemes posted 8 years ago Permalink

A great ideia using the checkbox for this option

Please login to leave a reply, or register at first.