QGIS icon indicating copy to clipboard operation
QGIS copied to clipboard

SQL console in QGIS Browser can't run just the selected part of an SQL statement (unlike DB Manager SQL console)

Open gioman opened this issue 1 year ago • 3 comments

What is the bug or the crash?

Title says it all. Also notice that the "clear" and "execute" buttons are not placed where expected... I find myself all the time pressing "clear" instead of "execute", and the damn thing does not even support undo (when pressing "clear").

Steps to reproduce the issue

Title says it all.

Versions

3.34.5

Supported QGIS version

  • [X] I'm running a supported QGIS version according to the roadmap.

New profile

Additional context

No response

gioman avatar Apr 20 '24 10:04 gioman

I find myself all the time pressing "clear" instead of "execute"

because of course in DB Manager that we all use since ages, that buttons order is inverted.

gioman avatar Apr 20 '24 10:04 gioman

My bad, definitively a feature request and not a bug. Also apologies for the harsh comment: I had just wiped out a very complex query and just found there was no UNDO.

gioman avatar Apr 22 '24 08:04 gioman

@gioman

I had just wiped out a very complex query and just found there was no UNDO.

Try this (from the qgis python console):

w=QgsHistoryWidget("dbquery")
w.show()

Should give you a dialog listing a (seachable) history of all sql executed from the browser :+1: Double click an entry to re-open it in the sql dialog.

nyalldawson avatar Apr 22 '24 21:04 nyalldawson