Run SQL query
draxlr_run_queryRun a read-only SQL query against a Draxlr database and return the resulting rows. Only read (SELECT) queries are allowed. Returns a queryId that can be passed to draxlr_save_query or draxlr_add_query_to_dashboard, and a url to view the query in Draxlr.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sql | Yes | The SQL query to run. Must be a read-only (SELECT) query. 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. | |
| page | No | Page number for pagination (default 1) | |
| pageSize | No | Rows per page (default 25) | |
| 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 (from draxlr_list_databases) |