Skip to main content

blank_string_literals

Function blank_string_literals 

Source
pub fn blank_string_literals(sql: &str) -> String
Expand description

Blank out the contents of every string literal, preserving byte offsets, line breaks and the surrounding quotes.

strip_comments skips over quoted regions but leaves their text in place, so a keyword scan run on its output still sees words that are data rather than SQL — INSERT INTO runbook VALUES ('nightly VACUUM of orders') read as a VACUUM statement. Blanking the interior keeps every offset and line number intact, so diagnostics still point at the original source.

Quoted identifiers ("...", `...`) are deliberately left alone: they name real objects and callers need to read them.