Inline database quotation functions
This commit is contained in:
parent
01d502337d
commit
9d0b632e9c
|
@ -148,10 +148,12 @@ pub async fn close_database_connection(conn: MySqlConnection) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[inline]
|
||||||
pub fn quote_literal(s: &str) -> String {
|
pub fn quote_literal(s: &str) -> String {
|
||||||
format!("'{}'", s.replace('\'', r"\'"))
|
format!("'{}'", s.replace('\'', r"\'"))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[inline]
|
||||||
pub fn quote_identifier(s: &str) -> String {
|
pub fn quote_identifier(s: &str) -> String {
|
||||||
format!("`{}`", s.replace('`', r"\`"))
|
format!("`{}`", s.replace('`', r"\`"))
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue