Expand description
Local validation for SQL sent by read-only BigQuery features.
Mirrors kumosql.sql_validation: a query must be exactly one read-only SELECT (with CTEs,
subqueries, set operations or pipe operators), at most 20,000 characters, and nothing in its
tree may write, define or run anything. Errors never echo the SQL or the parser’s excerpt.
Constants§
- MAX_
READONLY_ QUERY_ CHARS - The longest query (in characters) the read-only check accepts.
Functions§
- quote_
table_ path - Quote a strict
project.dataset.tablepath in backticks, refusing any SQL punctuation. - validate_
readonly_ query - Require exactly one read-only
SELECTstatement (CTEs, subqueries, set operations and pipe syntax allowed) of at mostMAX_READONLY_QUERY_CHARScharacters. Comments, and semicolons after the statement, are fine. - validate_
readonly_ query_ with_ max validate_readonly_querywith another bound on the text:max_charscharacters. Features that store queries keep the 20,000 default; a one-off runner may allow more.