pub struct SqlConfig {
pub enabled: bool,
pub max_rows: u64,
}Expand description
Raw-SQL query endpoint ([sql] block).
Exposes POST /api/v1/sql, which accepts an arbitrary read-only
SELECT in the request body and runs it against the engine. Off by
default — raw SQL is a larger attack surface than the structured
/query endpoint, so it must be opted into explicitly.
Phase 1 is scoped to a single dataset per query: the statement may reference at most one registered dataset (and no others / no files), enforced by a parse-time table allowlist. Cross-dataset joins are a future extension.
Safety rails applied to every accepted statement:
- exactly one statement, and it must be a read-only
SELECT/WITH, - every referenced table must be a registered dataset (no file
functions, no
ATTACH/COPY/PRAGMA/DDL/DML), - the result is hard-capped at
SqlConfig::max_rowsrows.
Fields§
§enabled: boolEnable the POST /api/v1/sql endpoint. Default false.
max_rows: u64Hard cap on the number of rows a single SQL query may return.
The query result is wrapped in an outer LIMIT so this bound is
enforced regardless of the user’s own LIMIT. Default 100_000.