mirror of
https://github.com/chatmail/core.git
synced 2026-04-17 21:46:35 +03:00
sql: cleanup usage of ToSql
Moved custom ToSql trait including Send + Sync from lib.rs to sql.rs. Replaced most params! and paramsv! macro usage with tuples. Replaced paramsv! and params_iterv! with params_slice!, because there is no need to construct a vector.
This commit is contained in:
@@ -30,7 +30,7 @@ pub async fn run(context: &Context, sql: &Sql) -> Result<(bool, bool, bool, bool
|
||||
// set raw config inside the transaction
|
||||
transaction.execute(
|
||||
"INSERT INTO config (keyname, value) VALUES (?, ?);",
|
||||
paramsv![VERSION_CFG, format!("{dbversion_before_update}")],
|
||||
(VERSION_CFG, format!("{dbversion_before_update}")),
|
||||
)?;
|
||||
Ok(())
|
||||
})
|
||||
@@ -746,7 +746,7 @@ impl Sql {
|
||||
fn set_db_version_trans(transaction: &mut rusqlite::Transaction, version: i32) -> Result<()> {
|
||||
transaction.execute(
|
||||
"UPDATE config SET value=? WHERE keyname=?;",
|
||||
params![format!("{version}"), VERSION_CFG],
|
||||
(format!("{version}"), VERSION_CFG),
|
||||
)?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user