Fixed an issue where EXPLAIN should run on query under cursor if no text is selected. #9297

pull/9327/head
Anil Sahoo 2025-11-18 12:17:46 +05:30 committed by GitHub
parent 39c2f397f7
commit d6b2379fbe
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 2 deletions

View File

@ -275,6 +275,8 @@ the drop down on the right side of *Explain Analyze* button in the toolbar.
Please note that pgAdmin generates the *Explain [Analyze]* plan in JSON format.
**Note**: If multiple queries are present and none is selected, *Explain [Analyze]* runs the query located at the cursor position.
On successful generation of *Explain* plan, it will create three tabs/panels
under the Explain panel.

View File

@ -146,8 +146,8 @@ export default function Query({onTextSelect, setQtStatePartial}) {
const regex = /\$SELECTION\$/gi;
query = macroSQL.replace(regex, query);
external = true;
} else if(executeCursor) {
/* Execute query at cursor position */
} else if(executeCursor || explainObject) {
/* Execute query at cursor position or explain query at cursor position */
query = query || editor.current?.getQueryAt(editor.current?.state.selection.head).value || '';
} else {
/* Normal execution */