Skip to main content

is_modifying

Function is_modifying 

Source
pub fn is_modifying(sql: &str) -> bool
Expand description

Detect whether a SQL statement is modifying (DML/DDL).

A statement is considered modifying if a DML/DDL keyword appears at top-level (parenthesis depth ≤ 0). This correctly handles WITH CTEs that are followed by INSERT / UPDATE / DELETE / MERGE — the bug that the previous first-token-only check missed.