Skip to main content

quote_string

Function quote_string 

Source
pub fn quote_string(v: &str) -> String
Expand description

Quote a string for SQL: wrap in single quotes, escape ' as ''.

This is the SQL-standard single-quote escaping accepted by every supported backend; it guards against injection through string values when building literals inline rather than via bind parameters.