What the lexer and parser found wrong, in text order.
The dialect the text was read with.
Whether everything was read: no Unknown node and no diagnostic above Info.
The statements, in order. An empty statement (;;) is not included.
The token stream.
Every identifier path that can be a column, with its clause and bound source when resolvable.
Output names used more than once in the first statement's output. Incomplete when the output has a star, whose names are not known without the catalog.
An empty edit set over this document's text.
Whether the document holds more than one statement.
Whether the document is exactly one read statement. SELECT … INTO, writes in CTEs or
subqueries, row locks, non-query statements and stacked statements are refused, with the
reason; so is anything that could not be read (fail closed).
The first statement's output columns; for a set operation, the first branch's, plus every branch's.
The document printed from its tokens: equal to the input, byte for byte.
Catalog-free name resolution: CTE visibility, FROM-source names and qualifier binding.
The kind of each statement.
Every table, CTE and table-valued function read anywhere, subqueries and CTE bodies included.
The first statement's top-level ORDER BY, with its exact span; null when there is none.
The top-level query expression of the first statement; null when it is not a query.
Every construct that reads or compares whole rows: stars, FOR JSON / XML, NATURAL JOIN, set operations, ….
StaticParseParses SQL text. Never throws.
The SQL, one or more statements.
The dialect whose lexical and grammar rules read it.
A SQL text in one dialect, parsed into statements by MJ's tolerant structural parser.
Unknownnode plus a diagnostic, and the rest of the tree is still read.SqlExpression) with helpers for identifier paths, function calls and stars; nested(SELECT …)are parsed as child queries.Completeis false whenever an Unknown node or a parse diagnostic could affect the answer.Template tags are not part of SQL: render the template first. A tag in the text is read as an opaque value and reported with a diagnostic.