Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing Execute query functionality #6841

Closed
atiris opened this issue Oct 9, 2023 · 4 comments
Closed

Missing Execute query functionality #6841

atiris opened this issue Oct 9, 2023 · 4 comments

Comments

@atiris
Copy link

atiris commented Oct 9, 2023

Describe the bug

Currently, pgAdmin does not provide any functionality that could be called Execute query.

Although the keyboard shortcuts section contains "Execute query" option, using this shortcut will not actually run the query. Instead, the entire script is executed (all queries listed in the editor, regardless of which query is currently edited). It is possible to select a block and run the given block of code, but this is not "Execute query" in the sense in which it is understood by standard. Such behavior is usually called "Execute script" or "Execute selection".

Since the function to run an active query, I working on (either selected by marking the given text of this query or the one on which the cursor is currently placed) is essential for the sql editor, I rate it as a bug, not as a feature request.

Please don't reject this request just by sticking to historical decisions If you do not agree that this is a bug, then at least change the status of this request to a feature request and assign it a low priority. After all, the addition of new functionality won't certainly cause any harm and will definitely help some users.

To Reproduce

Steps to reproduce the behavior:

  1. Write 1. query into Query Tool and terminate it with semicolon.
  2. Use keyboard shortcut for "Execute query".
  3. Write 2. query and terminate it.
  4. Use the program function labeled as "Execute query".
  5. All queries (entire script) is executed without asking which query I want to execute.

Expected behavior

As the name of this functionality says, a (single / active) query should be executed.

Desktop (please complete the following information):

  • OS: Windows-10-10.0.19045-SP0
  • Version: 7.7
  • Mode: Desktop
  • Browser: Chromium 114.0.5735.91

Additional context

Clone from redmine.postgresql.org issue 7885 as I don't know which place to report the error is correct.

@atiris atiris added the Bug label Oct 9, 2023
@agaillar
Copy link

As far as I'm concerned, being able to execute the current query (where the cursor is positioned) is an essential and indispensable feature.
It's because of this lack that I regularly switch to the CloudBeaver editor, even though it's less complete than PGAdmin.

@anthonydb
Copy link
Contributor

I'd like to chime in and support this feature's development. It's one of the features I like most about DataGrip and would love to see happen in pgAdmin as well.

@adityatoshniwal
Copy link
Contributor

@anthonydb Sure you can. But may be wait for one in progress upgrade of CodeMirror 5 to 6 - the UI editor library. Once done, it will be easy for you to parse the queries separated by semi-colon.

anilsahoo20 added a commit to anilsahoo20/pgadmin4 that referenced this issue May 22, 2024
…gadmin-org#6841

Added support for executing query at cursor position in query tool. pgadmin-org#6841

commit
@anilsahoo20 anilsahoo20 removed their assignment May 27, 2024
@pravesh-sharma pravesh-sharma self-assigned this May 29, 2024
@pravesh-sharma
Copy link
Contributor

Tested feature on candidate build with both provided test cases and additional ones, is working as expected.

Env:
OS - macOS Sonoma 14.4.1
Mode - Desktop

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants