Create DataLens saved SQL query
datalens_sqlqueries_createSave a SQL query in a DataLens workbook and return it for reuse. Requires an enabled SQL editor; disabled editors return 403 SQL_EDITOR_NOT_ALLOWED.
Instructions
Save a SQL query in a workbook and return it.
Experimental in the DataLens API and written from its document: not measured. An
organization whose SQL editor is off answers 403 SQL_EDITOR_NOT_ALLOWED.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | The query's name in the workbook. | |
| query | Yes | The text of the query. | |
| params | No | The parameters the text takes: a name, a type and a default each. | |
| description | No | A description. | |
| workbook_id | Yes | The workbook to keep it in. | |
| connection_id | Yes | The connection it runs over: PostgreSQL, ClickHouse, MySQL, Greenplum, Trino. |