Yandex Cloud
Search
Contact UsGet started
  • Blog
  • Pricing
  • Documentation
  • All Services
  • System Status
    • Featured
    • Infrastructure & Network
    • Data Platform
    • Containers
    • Developer tools
    • Serverless
    • Security
    • Monitoring & Resources
    • ML & AI
    • Business tools
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Customer Stories
    • Gateway to Russia
    • Cloud for Startups
    • Education and Science
  • Blog
  • Pricing
  • Documentation
Yandex project
© 2025 Yandex.Cloud LLC
Yandex WebSQL
  • Getting started
    • All guides
    • Creating a connection
    • Connection management
    • Viewing information about database objects
    • Working with the query editor
    • Working with saved queries
    • Working with query history
  • Access management
  • Pricing policy
  • Audit Trails events

In this article:

  • Saving a query as a template
  • Using a saved query
  • Editing a saved query
  • Publishing a query
  • Configuring access permissions for a published query
  • Deleting a saved query
  1. Step-by-step guides
  2. Working with saved queries

Working with saved queries

Written by
Yandex Cloud
Updated at March 6, 2025
  • Saving a query as a template
  • Using a saved query
  • Editing a saved query
  • Publishing a query
  • Configuring access permissions for a published query
  • Deleting a saved query

You can save any query to use it later and create a template out of it. The Saved queries section enables you to:

  • Save a query as a template.
  • Use a saved query.
  • Edit a saved query.
  • Publish a saved query.
  • Configure access permissions for a published query.
  • Delete a saved query.

Saving a query as a templateSaving a query as a template

To save a query:

Query editor
**Saved queries** section
  1. In the Connections section, connect to the database and go to the query editor.
  2. In the data panel, click next to the Execute button.
  3. In the Save query window:
    1. Select the database to query. By default, the current database is specified in this field.

    2. Specify a Name, i.e., any name under which the query will be displayed in the list of saved queries.

    3. For your saved query to be used as a template in the suggestions list, select Add tip and type the Tip text including userTemplate_.

      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.

    4. Review or edit the query.

    5. Click Save.

  1. Open Yandex WebSQL.

  2. Go to the Saved queries section.

  3. In the top-right corner, click .

  4. In the window that opens:

    1. Select a connection to the queried database.

    2. Specify a Name, i.e., any name under which the query will be displayed in the list of saved queries.

    3. For your saved query to be used as a template in the suggestions list, select Add tip and type the Tip text including userTemplate_.

      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.

    4. Enter the query text.

    5. Click Save.

After you save the query, it will appear in the Saved queries window. If you have added a suggestion, it will appear as a template along with the ready-made Yandex WebSQL templates.

Using a saved queryUsing a saved query

Query editor
**Saved queries** section
  1. Begin typing template in the query field.
    The suggestions list will show the saved userTemplate_* templates and ready-made templates:

    • template_CREATE
    • template_DELETE
    • template_DROP_TABLE
    • template_INSERT
    • template_SELECT
    • template_UPDATE
  2. Select the template you need from the suggestions list.

  3. Add relevant parameters to the template. Use the TAB key to switch between the parts of the template you are adding parameters to.

  4. Click Run.

  1. Go to the Saved queries section.
  2. Click to the right of the query you need and select Use query: it will show up in the data panel.
  3. Click Open in editor.
  4. (Optional) Update query parameters.
  5. Click Execute.

Editing a saved queryEditing a saved query

To edit a saved query:

  1. Go to the Saved queries section.

  2. Click to the right of the query you need and select Edit query.

  3. In the window that opens:

    1. Select the database to query.

    2. Specify a Name, i.e., any name under which the query will be displayed in the list of saved queries.

    3. Add, edit, or delete a suggestion.

      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.

    4. Review or edit the query.

  4. Click Save.

Publishing a queryPublishing a query

You can publish your query. Once published, the query will be available to all folder users. You cannot unpublish a query.

To publish a query:

  1. Go to the Saved queries section.

  2. Click to the right of the query you need and select Publish query.

  3. In the window that opens, click Publish.

You will see next to the name of the published query.

Configuring access permissions for a published queryConfiguring access permissions for a published query

To configure access permissions:

  1. Go to the Saved queries section.

  2. Click to the right of the query you need and select Access permissions.

  3. In the window that opens, click Assign roles.

  4. Assign the required roles and click Save.

Deleting a saved queryDeleting a saved query

To delete a saved query:

  1. Go to the Saved queries section.

  2. Click to the right of the query you need and select Delete.

  3. In the window that opens, click Apply.

Was the article helpful?

Previous
Working with the query editor
Next
Working with query history
Yandex project
© 2025 Yandex.Cloud LLC