Module sqlib::escaping

source ·
Expand description

escaping provides functions for the Server Query escaping.

Example

use sqlib::escaping::{escape, unescape};

let unescaped = "hello world/|\\".to_string();
let escaped = "hello\\sworld\\/\\p\\\\".to_string();

let escaped_test = escape(&unescaped);
let unescaped_test = unescape(&escaped);

assert_eq!(escaped_test, escaped);
assert_eq!(unescaped_test, unescaped);

Functions

escapes all chars described in the server query manual
unescapes all chars described in the server query manual