mirror of
https://github.com/chatmail/core.git
synced 2026-04-22 16:06:30 +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:
@@ -1668,10 +1668,7 @@ impl MimeMessage {
|
||||
{
|
||||
context
|
||||
.sql
|
||||
.query_get_value(
|
||||
"SELECT timestamp FROM msgs WHERE rfc724_mid=?",
|
||||
paramsv![field],
|
||||
)
|
||||
.query_get_value("SELECT timestamp FROM msgs WHERE rfc724_mid=?", (field,))
|
||||
.await?
|
||||
} else {
|
||||
None
|
||||
@@ -2352,7 +2349,7 @@ mod tests {
|
||||
.sql
|
||||
.execute(
|
||||
"INSERT INTO msgs (rfc724_mid, timestamp) VALUES(?,?)",
|
||||
paramsv!["Gr.beZgAF2Nn0-.oyaJOpeuT70@example.org", timestamp],
|
||||
("Gr.beZgAF2Nn0-.oyaJOpeuT70@example.org", timestamp),
|
||||
)
|
||||
.await
|
||||
.expect("Failed to write to the database");
|
||||
|
||||
Reference in New Issue
Block a user