Skip to content

SQL Plugin "select data" action for tables

Small Quality of Life improvement, that adds "select data" to table right click actions Screenshot_20211128_194929

Lack of this feature caused me huge amount of frustration

And I hope that now, people not gonna have to go through this PIA to view table data
  1. Open new tab

  2. select "select" from "generate query" menu to paste query in this tab

  3. press "run query" in separate menu

  4. Either Close tab and have to repeat step 1. for every table I want to view OR constantly have one extra tab open that I still have to clear to view other table (since default action generates "select" query with all fields, instead of generic "select * from X" where I can easily change the table name)

A bit reworked schemawidget for this

Made that so "generateStatement" function return statement instead of creating it and automatically pasting it into active view. (For this functionality to be still available added "generateAndPasteStatement" function. And (purely for naming consistency) renamed functions that use it from "GenerateX" into "GenerateXIntoView")

Added "generic" function "execute statement" so it can be reused when/if "bind parameters" for "insert"/"delete" query is added. (and, of course, it's used by "executeSelect" function that I bound to new menu action)

And (in first commit) cleaned up code a bit by replacing few "magic numbers" with static constants
Edited by artyom kirnev

Merge request reports