Module mysql.escape

Escape special characters in MySQL strings.

Note, it is strongly recommended to use prepared statements instead of relying on manual escaping, as prepared statements are always safer, better and more reliable (see mysql.prepared). But if you absolutely must escape manually, the functionality is provided here.

Functions

NameDescription
mysql_escape(input, output) Simple escape function for dangerous SQL characters
mysqlEscape(input) Helper function to easily construct a escape wrapper struct

Structs

NameDescription
MysqlEscape Struct to wrap around an input range so it can be passed to formattedWrite and be properly escaped without allocating a temporary buffer