Skip to main content

Saved Queries

A saved query is a named, reusable SQL statement tied to a database service. List, retrieve, update, and delete operations enforce ownership. The execute route has a separate access limitation described below. POST /v1/queryRunner/savedQueries takes serviceName, name, and queryText, all required. PUT accepts name and/or queryText to update.
Note: POST .../execute checks the query is read-only and returns metadata about it. It doesn’t run the query itself.
To actually execute it, pass its queryText to Query Execution.
In Collate 2.0.2, the execute route does not check saved-query ownership. An authenticated caller with access to the database service who knows a saved-query ID can receive its read-only SQL text. Do not treat saved-query text as owner-only until this route enforces ownership.

Example

The following request saves a query.