Lotus.SQL.Sanitizer (Lotus v0.16.5)

Copy Markdown View Source

Shared helpers for cleaning SQL strings before further processing.

Summary

Functions

Strips a trailing semicolon (and surrounding whitespace) from a SQL string.

Functions

strip_trailing_semicolon(sql)

@spec strip_trailing_semicolon(String.t()) :: String.t()

Strips a trailing semicolon (and surrounding whitespace) from a SQL string.

This is used by injectors that wrap queries in CTEs, where an embedded trailing semicolon would be misdetected as a multi-statement query.