mirror of
https://github.com/chatmail/core.git
synced 2026-04-21 15:36:30 +03:00
refactor(sql): do not expose rusqlite Error type in query_map methods
We use query_and_then() instead of query_map() function now. The difference is that row processing function returns anyhow::Result, so simple fallible processing like JSON parsing can be done inside of it when calling query_map_vec() and query_map_collect() without having to resort to query_map() and iterating over all rows again afterwards.
This commit is contained in:
@@ -732,8 +732,8 @@ impl Context {
|
||||
"SELECT update_item, id FROM msgs_status_updates WHERE msg_id=? AND id>? ORDER BY id",
|
||||
(instance_msg_id, last_known_serial),
|
||||
|row| {
|
||||
let update_item_str = row.get::<_, String>(0)?;
|
||||
let serial = row.get::<_, StatusUpdateSerial>(1)?;
|
||||
let update_item_str: String = row.get(0)?;
|
||||
let serial: StatusUpdateSerial = row.get(1)?;
|
||||
Ok((update_item_str, serial))
|
||||
},
|
||||
|rows| {
|
||||
|
||||
Reference in New Issue
Block a user