StaticCollectEvery FROM item an already-parsed statement reads, and the number of SELECTs in its tree,
walking the whole tree with CTE scope. skip is a FROM item node of parser's own tree to
leave out.
Optionalskip: objectStaticContainsTrue when a parse tree (such as SQLParser.AST) holds a write, DDL or DCL statement at any
depth. Any other value holds none.
StaticValidateWhether expression may be placed as one item of an aggregate SELECT list —
SELECT <expression> AS [Agg_0] FROM <entity view> WHERE … — for an entity whose columns are
columns, and the SQL to run for it: exactly one aggregate call (COUNT, SUM, AVG, MIN, MAX,
STDEV, VAR, STRING_AGG, …) over the given columns, constants, operators, CASE, CAST and a
fixed set of pure scalar functions. The caller's text is never run:
StrictAggregateResult.SQL is rebuilt from the checked parse tree with the dialect's
quoting, so the database runs exactly the expression that was checked.
StaticValidateReads a WHERE fragment as the predicate of SELECT 1 FROM __mj_clause_screen WHERE …. With
StrictParseOptions.CollectReads, the reads leave out that wrapper's own FROM item.
Optionaloptions: StrictFilterOptionsStaticValidateReads an ORDER BY list as the ORDER BY of SELECT 1 FROM __mj_clause_screen ORDER BY ….
With StrictParseOptions.CollectReads, the reads leave out that wrapper's own FROM item.
Optionaloptions: StrictParseOptionsStaticValidateReads a whole statement, which is valid when it is one plain read-only SELECT.
Optionaloptions: StrictParseOptions
SECURITY — the strict, fail-closed reader for SQL that untrusted callers supply: a WHERE or ORDER BY fragment, an aggregate expression, or a whole read statement. Text the dialect's grammar cannot read is refused, never guessed at, so use it only where refusing unparseable input is correct, and never to rewrite SQL MJ owns.
The grammar is the dialect's grammar facet (
Grammar.ParserGrammar: TransactSQL, PostgresQL, MySQL, Snowflake, Hive), or theParserDialectof a dialect without the facet. A dialect whose facet names no grammar is refused ('NoGrammar').Every result carries the facts a screen decides on (statement kind, top-level and nested writes, the relations read, the column references) as plain MJ types, so a caller never reads a parse tree.