Skip to main content

quote_literal

Function quote_literal 

Source
pub fn quote_literal(value: &str) -> String
Expand description

Wraps value in single quotes for use as a SQL string literal.

Escapes backslashes and single quotes by doubling them. Backslash doubling is required for safety under MySQL’s default SQL mode, which treats \ as an escape character inside string literals.