This document proposes a UI for invoking the Visual SQL Editor (aka Query Editor) from nodes in the DB Explorer.
There are currently two context menu items available for executing database commands from DB Explorer nodes:
The proposed change would add a new item, "Design Query..." to some nodes, as outlined below.
The VSE was developed as part of Creator / VisualWeb, to enable visual development of queries. It is still used in VisualWeb, for customizing the queries that define RowSets for databinding.
Nothing in the VSE is specific to VisualWeb, so it can be useful to Netbeans users who may want an easy way of constructing queries. The DB Explorer is a natural way to access the functionality.
The current proposal is to make the VSE accessible from Concrete Table and Column nodes, which are tied to database contents. For simplicity, "Execute Command...", which is more generic would be removed from these nodes, but retained on the higher level nodes like Connection and Table.
The VSE is described elsewhere
This document only discusses the means of accessing it from the DB Explorer.
User navigates within the DB Explorer to a specific table or column and opens the Visual SQL Editor (VSE) to examine the associated data.
VSE opens with a context-dependent default query. User can modify either visually or textually, and re-run as necessary.
A new menu item, "Design Query..." would be added to the contextual menu of the DB Explorer nodes for Concrete Table and Column. This would replace "Execute Command...", which would be dropped from those nodes.
"Design Query..." would invoke the VSE, with a context-dependent default query, which is the same as the one used by "View Data...". However, the query would not be executed by default.
Contextual Menu:
Create Table...
Add Column...
Refresh
--------
Grab Structure...
Recreate Table...
--------
View Data...
Design Query...
--------
Delete
Properties
Default query is 'SELECT * FROM <table>'.
Contextual Menu:
Add Column...
--------
View Data...
Design Query...
--------
Delete
Properties
Default query is 'SELECT <column> FROM <table>'.
The "Design Query..." item could also be added to the higher-level nodes in the DB Explorer (Connection, Table, View). In that case it would not open with a default query.