API: SqlConsole
Read-only SQL console over ClickHouse (project-scoped, row-policy isolated).
На этой странице
Раздел собран из спецификации OpenAPI продукта: 3 метод(ов). Поверхность — query-api (основной API, база /api/v1). Все методы требуют аутентификации.
Методы раздела
/projects/{id}/sql Execute a read-only SQL query against ClickHouse (analyst+)
Requires sql_console in the cloud EffectivePlan or in the current verified on-prem signed-license feature subset. Query runs as a read-only ClickHouse user scoped to this project by row policy, with max_execution_time=30, max_rows_to_read=2e9, max_result_rows=10000.
Параметры
| Имя | Где | Тип | Описание |
|---|---|---|---|
id обязателен | Путь | integer (int32) | Project id. |
Тело запроса application/json , обязательно
| Поле | Тип | Описание |
|---|---|---|
query обязательно | string | |
max_rows необязательно | integer | Row cap for the result (≤10000) |
Ответы
| Код | Что означает | Тело |
|---|---|---|
| 200 | Query result | SqlResult |
| 401 | Missing or invalid credentials (code=unauthorized) | Error |
| 403 | Authenticated but not permitted (code=forbidden) | Error |
| 404 | Resource not found (code=not_found) | Error |
| 408 | Query exceeded the endpoint-specific timeout (code=query_timeout) | Error |
| 422 | Request failed validation (code=validation_failed) | Error |
/projects/{id}/sql/history Last 50 console runs from the sql_audit log (analyst+)
Requires sql_console in the cloud EffectivePlan or in the current verified on-prem signed-license feature subset. Fixed window of the 50 most recent entries, newest first. Analysts see only their own runs; admins and owners see all runs in the project.
Параметры
| Имя | Где | Тип | Описание |
|---|---|---|---|
id обязателен | Путь | integer (int32) | Project id. |
Ответы
| Код | Что означает | Тело |
|---|---|---|
| 200 | History entries | object |
| 401 | Missing or invalid credentials (code=unauthorized) | Error |
| 403 | Authenticated but not permitted (code=forbidden) | Error |
| 404 | Resource not found (code=not_found) | Error |
/projects/{id}/sql/templates List business SQL templates enabled by confirmed project semantics (analyst+)
Requires sql_console. Returns an empty list until the customer confirms a ready meaningful-activity definition. SQL is rendered server-side from validated event names and checked by the console guard, but is not executed by this endpoint.
Параметры
| Имя | Где | Тип | Описание |
|---|---|---|---|
id обязателен | Путь | integer (int32) | Project id. |
Ответы
| Код | Что означает | Тело |
|---|---|---|
| 200 | Available project-specific templates. | object |
| 401 | Missing or invalid credentials (code=unauthorized) | Error |
| 403 | Authenticated but not permitted (code=forbidden) | Error |
| 404 | Resource not found (code=not_found) | Error |
Источник раздела — docs/api/openapi.yaml репозитория продукта,
версия API 1.0.0, OpenAPI 3.0.3,
снимок 095579325c2d.
Расхождение снимка со спецификацией роняет сборку документации.