Save SQL query
draxlr_save_querySave a SQL query to a Draxlr database so it appears under the database's saved queries. Provide either sql (it is executed then saved) or a queryId returned by draxlr_run_query.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sql | No | The SQL to save. Provide either this or queryId. If you add variables, write them as {{variableName}} using letters only (e.g. {{startDate}}); numbers, underscores and other special characters are not allowed. Pass their values in `variables`, or wrap each condition that uses a variable in [[ ]] (e.g. WHERE 1=1 [[AND created_at >= {{startDate}}]]) so it is skipped when no value is given. | |
| name | Yes | Name for the saved query | |
| queryId | No | A queryId from draxlr_run_query. Provide either this or sql. | |
| variables | No | Values for the {{variables}} used in the SQL, keyed by variable name, e.g. { "startDate": "2026-01-01" }. Use an array for IN lists. | |
| databaseId | Yes | The database id the query belongs to | |
| description | No | Optional description for the saved query |