mirror of
https://github.com/chatmail/core.git
synced 2026-04-17 21:46:35 +03:00
bind value to sql using ?-operator
This commit is contained in:
committed by
holger krekel
parent
7b83979e10
commit
98266f47d6
@@ -1008,13 +1008,12 @@ pub fn get_rowid_with_conn(
|
||||
// the ORDER BY ensures, this function always returns the most recent id,
|
||||
// eg. if a Message-ID is split into different messages.
|
||||
let query = format!(
|
||||
"SELECT id FROM {} WHERE {}='{}' ORDER BY id DESC",
|
||||
"SELECT id FROM {} WHERE {}=? ORDER BY id DESC",
|
||||
table.as_ref(),
|
||||
field.as_ref(),
|
||||
value.as_ref()
|
||||
);
|
||||
|
||||
match conn.query_row(&query, NO_PARAMS, |row| row.get::<_, u32>(0)) {
|
||||
match conn.query_row(&query, params![value.as_ref()], |row| row.get::<_, u32>(0)) {
|
||||
Ok(id) => id,
|
||||
Err(err) => {
|
||||
error!(
|
||||
|
||||
Reference in New Issue
Block a user