Working with saved SQL queries
Note
This feature is in the Preview stage.
You can save any SQL query to use it whenever you need and create a template.
Saving a query
To save a query:
- In the data panel, for any query, click
next to the Execute button. - In the Save query window:
-
Select a connection to the database being queried.
-
Specify the Name: a user-defined name under which the query will be displayed in the list of saved queries.
-
For your saved query to be used as a template in the suggestions list, select Add tip and type the Tip text including
userTemplate_
. -
Verify or edit the SQL query.
Tip
If you add a suggestion and specify a template name, you can include in the query the arguments to be highlighted when this template is selected, such as
SELECT $1 FROM employees LIMIT $2
. -
Click Save.
-
After you save the query, it will appear in the Saved queries (
Queries are saved for the selected Yandex Cloud organization and current browser session.
Using templates
To apply templates:
-
Begin typing
template
in the query field.
The suggestions list will show the saveduserTemplate_*
templates and ready-made templates:template_CREATE
template_DELETE
template_DROP_TABLE
template_INSERT
template_SELECT
template_UPDATE
-
Select the template you need from the suggestions list.
-
Add relevant parameters to the template. Use the
TAB
key to switch between the parts of the template you are adding parameters to. -
Click Run.