Table of Contents
SQL Editor - Left Side Panel Help
The Left Side Panel (or Navigator) of Valentina SQL Editor assists in writing queries. It allows you to access several different tabs including Schema Tab, Queries Tab, Templates Tab, and Snippets Tab. Click on each tab within the navigator to display the objects of the tab.
DB Schema Tree Tab
The Schema tab panel displays the schema tree of the current database to help you write SQL queries more effectively.
You can filter the tree using the filter field located at the bottom of the tab.
Double-Click Object
Double-click a Schema object in the Schema tab to add a reference into the SQL Editor at the current cursor position.
The addition to your code is appropriate to the type of Schema object.
Drag and Drop Database Objects
You can drag objects from the navigator into the main edit area. When objects are dropped into the edit area, Valentina Studio displays a dialog for editing options for the SQL command.
If you drag a Table into the main edit area, you will see:
Drag Container of Database Objects
You can drag entire folders with database objects, e.g. Tables or Fields. After dropping the objects, you get a comma-separated list with the names of all its elements:
For Tables:
"actor", "address", "category", "city", "country", "customer", "film", "film_actor", "film_category", "film_text", "inventory", "language", "payment", "rental", "staff", "store", "T1"
For fields:
"actor"."actor_id", "actor"."first_name", "actor"."last_name", "actor"."last_update"
Schema Tab Contextual Menu
Queries Tab
The Queries tab-panel shows all queries, saved or created in the Valentina Studio Query Editor.
Double-click a query to set its text within the SQL Editor.
Queries Tab Toolbar
The Queries Tab toolbar is located at the bottom of the tab:
- “Add” button opens the Query Editor to create a new query;
- “Delete” button deletes the selected query;
- Filter field to filter queries by name.
Templates Tab
On the SQL Editor Templates Tab are predefined templates of SQL commands. Templates differ depending on the database engine used.
Double-click the template to add the text of the template to the SQL Editor.
Templates Tab Context Menu
Snippets Tab
The Snippets tab panel lets you create, edit and save your own named code snippets.
Double-click the snippet to add it at the current position of the text cursor or drag the snippet text to an arbitrary place.
After creation, the snippet is shown only for the current database.
In order to view all snippets, you can use the “Show Snippets For All Databases” option in the snippets navigator contextual menu. To make some snippets available to this database permanently “Show For Current Database” action of the snippet contextual menu is used. Also, it is possible to create “global” snippets visible to all databases and connections using the “Show For All Databases” action.
Snippets Tab Toolbar
The Snippets Tab toolbar is located at the bottom of the tab:
- “Add” button opens the dialog to create a new snippet;
- “Delete” button deletes the selected snippets;
- Filter field to filter snippets by name.
Snippet Object Contextual Menu
You can:
- Copy to Clipboard – Copies the snippet text to the clipboard;
- Send to SQL Editor – Appends the snippet text to the query in SQL Editor;
- Update from SQL Editor – Updates the snippet text with the query in SQL Editor;
- Edit… – Opens a dialog to edit snippet;
- Delete… – Deletes selected snippet;
- Show For All Databases – If ON, this snippet is shown for all databases. If OFF – only for databases allowed with Show For Current Database option;
- Show For Current Database – If ON, this snippet will be shown for the current database. If OFF – only if the snippet has Show For All Databases option.
The list of snippets supports multiple selections. For the multiple snippets the context menu will look like this:
Snippet Navigator Contextual Menu
Click in the empty space of the tab to view actions that can be performed over all created snippets.
- Add Snippet… – Opens a dialog to create a new snippet;
- Import… – Import snippets from a file on disk. After the import, you may need to allow the imported snippets to be shown for the current database if necessary;
- Export… – Export snippets to file on disk;
- Show Snippets For All Databases – If ON, this list shows all created snippets. If OFF – only snippets allowed for the current database.