diff --git a/src/data/base_request_handler.rs b/src/data/base_request_handler.rs index daa0f4d..70d7eb9 100644 --- a/src/data/base_request_handler.rs +++ b/src/data/base_request_handler.rs @@ -357,7 +357,7 @@ pub trait BaseRequestHandler { } fn post_positive_u64_opt(&mut self, name: &str) -> Res> { - match self.post_u64(name)? { + match self.post_u64_opt(name, 0)? { 0 => Ok(None), val => Ok(Some(val)) } diff --git a/src/helpers/database.rs b/src/helpers/database.rs index 4e8e3bd..032cbae 100644 --- a/src/helpers/database.rs +++ b/src/helpers/database.rs @@ -944,6 +944,13 @@ pub fn update(u: UpdateInfo) -> ResultBoxError<()> { query_sql = format!("{} {} WHERE {}", query_sql, updates, conditions); + if conf().database.log_all_queries { + watcher::ExecDatabaseQuery::new( + &query_sql, + &values.iter().map(|f| mysql::Value::from(f)).collect(), + ).display(); + } + get_connection()?.exec_drop( query_sql, values,