Skip to main content

validate

Function validate 

Source
pub fn validate(
    sql: &str,
    allowed: &HashSet<String>,
    max_datasets: usize,
) -> Result<ValidatedSql, AppError>
Expand description

Validate sql for the raw-SQL endpoint.

allowed is the set of registered dataset names, lowercased by the caller (matching is case-insensitive). max_datasets caps how many distinct datasets a single statement may touch (phase 1 = 1).

On success returns the cleaned SQL ready to be wrapped in an outer LIMIT and executed by the backend.