Skip to main content

classify_statement

Function classify_statement 

Source
pub fn classify_statement(sql: &str) -> StatementKind
Expand description

Coarse-classify the first SQL statement in sql after stripping leading whitespace and line/block comments.

First-keyword only: a WITH x AS (DELETE …) SELECT … CTE is classified as ReadOnly even though it mutates. Hyper itself rejects data-modifying CTEs, so this is a defense-in-depth heuristic rather than the only barrier.