pgadmin-org / pgadmin3

Archive of the pgAdmin III project
https://www.pgadmin.org/
Other
177 stars 82 forks source link

Keyboard shortcut to execute statement at cursor (RM #1439) #409

Closed dpage closed 1 year ago

dpage commented 8 years ago

Issue migrated from Redmine: https://redmine.postgresql.org/issues/1439 Originally created by Franck Dernoncourt at 2016-07-06 22:37:26 UTC.

In the query editor, it would be nice to have a keyboard shortcut to execute the statement at cursor. (e.g., MySQL Workbench, one can use the keyboard shortcut Ctrl + ENTER to execute the statement at cursor delineated with semi colons). F5 only executes the selected text, which means the user has to first select the text.

dpage commented 8 years ago

Comment migrated from Redmine: https://redmine.postgresql.org/issues/1439#note-1 Originally created by Daniel Ward at 2016-07-07 04:16:14 UTC.

Oracle SQL Developer has the same behaviour described by Franck. You press F5 to submit the entire script, or press F9 to run just the current statement. To implement, you simply trace backward until you encounter the first semicolon or the first forward slash. Then you trace forward until the next semicolon or forward slash. This lets you use forward slashes to separate code blocks. The reason I would use this function is to for when I interactively clean up user data - example - a properly formatted postal code may be entered, but when you lookup the address on a web service you see the postal code was entered incorrectly. To sift out the problem ones, I take the first few characters of the postal code and the city name and group them with a count. The one that is not like the others I investigate and then correct. This means I write out a series of different SQL statements, and execute a different statement depending on what I want to mine.

dpage commented 8 years ago

Comment migrated from Redmine: https://redmine.postgresql.org/issues/1439#note-2 Originally created by Dave Page at 2016-07-07 08:18:44 UTC.

We follow the pgAdmin 3 behaviour in this regard - when you execute a query (or explain etc), if any text is selected, only that text is executed. If nothing is selected, the entire query (or set of queries) are executed.

Redmine ticket header update:

Name Old Value New Value
Status changed New Rejected
dpage commented 8 years ago

Comment migrated from Redmine: https://redmine.postgresql.org/issues/1439#note-3 Originally created by Franck Dernoncourt at 2016-07-07 20:32:50 UTC.

Dave Page wrote:

We follow the pgAdmin 3 behaviour in this regard - when you execute a query (or explain etc), if any text is selected, only that text is executed. If nothing is selected, the entire query (or set of queries) are executed.

Why not creating a keyboard shortcut to execute the current statement?

dpage commented 8 years ago

Comment migrated from Redmine: https://redmine.postgresql.org/issues/1439#note-4 Originally created by Dave Page at 2016-07-07 22:44:44 UTC.

There is - it's shown on the button tooltip. It might have changed since the last beta, but off the top of my head I believe it's ctrl+shift+e (cmd+shift+e on Mac).

dpage commented 8 years ago

Comment migrated from Redmine: https://redmine.postgresql.org/issues/1439#note-5 Originally created by Franck Dernoncourt at 2016-07-08 15:32:19 UTC.

Dave Page wrote:

There is - it's shown on the button tooltip. It might have changed since the last beta, but off the top of my head I believe it's ctrl+shift+e (cmd+shift+e on Mac).

ctrl+shift+e executes all statements, not the current one. (current = where the cursor is located)

dpage commented 6 years ago

Comment migrated from Redmine: https://redmine.postgresql.org/issues/1439#note-6 Originally created by Alik Elzin at 2018-01-09 10:42:43 UTC.

I don't get it why was enhancement request reject. I user would like to execute a command at the line where the text cursor resides. Why would a user need to select the line in order to execute it? Sounds like a very reasonable request, especially if exists in other similar products, like SqlDeveloper.

Redmine ticket header update:

Name Old Value New Value
Status changed Rejected New
dpage commented 6 years ago

Comment migrated from Redmine: https://redmine.postgresql.org/issues/1439#note-7 Originally created by Chris Smith-Hill at 2018-04-24 11:03:19 UTC.

Dave Page wrote:

We follow the pgAdmin 3 behaviour in this regard - when you execute a query (or explain etc), if any text is selected, only that text is executed. If nothing is selected, the entire query (or set of queries) are executed.

So can this please be changed so the application is easier to use? Why would you reject a usability enhancement request?

dpage commented 1 year ago

Issue closed on Redmine.