validateQuerySyntax
fun validateQuerySyntax(fn: String, sql: String, reportErrors: Boolean = true): List<Statement>(source)
Parses sql and returns the parsed statement(s), so the result can be reused by the structural checks (rejectStackedStatements, validateColumnsExist, expandSelectStar) instead of re-parsing.
When reportErrors is true, malformed SQL raises an error; otherwise it returns an empty list (used when syntax validation is disabled but the other checks still want the AST when available).
Parameters
fn
Identifier of the function under validation, used in error messages.
sql
The SQL query string to parse.
reportErrors
Whether a parse failure should raise an error (syntax validation) or be ignored.