Skip to main content

Module sql_string

Module sql_string 

Source

Functions§

escape_sql_literal
Escapes value for safe interpolation inside a single-quoted SQL string literal, by doubling any embedded single quote (the standard SQL escaping - understood by Postgres, SQL Server, and SQLite alike). Every place in this crate that writes a user-supplied value (identifier, enum code, configured username, …) inside '...' must go through this first: an unescaped embedded quote breaks the generated SQL at best, or lets the value’s content escape the string literal and inject arbitrary SQL at worst.