Skip to main content

strip_leading_comments

Function strip_leading_comments 

Source
fn strip_leading_comments(query: &str) -> &str
Expand description

Strips leading whitespace and SQL comments.

All patterns above are anchored at the start of the statement, but JDBC clients such as DataGrip and DBeaver prefix every statement they send with a /* ApplicationName=... */ comment. Without stripping it first, those statements miss every pattern and reach the query engine, which rejects the ones this module exists to absorb.