mirror of
https://github.com/chatmail/core.git
synced 2026-05-13 11:56:30 +03:00
Simplify SQL statement
This commit is contained in:
@@ -5640,18 +5640,11 @@ async fn test_mark_message_as_delivered_only_after_sent_out_fully() -> Result<()
|
|||||||
pub(crate) async fn first_row_in_smtp_queue(alice: &TestContext) -> (MsgId, String) {
|
pub(crate) async fn first_row_in_smtp_queue(alice: &TestContext) -> (MsgId, String) {
|
||||||
alice
|
alice
|
||||||
.sql
|
.sql
|
||||||
.query_row_optional(
|
.query_row_optional("SELECT msg_id, mime FROM smtp ORDER BY id", (), |row| {
|
||||||
r#"
|
let msg_id: MsgId = row.get(0)?;
|
||||||
SELECT id, msg_id, mime, recipients
|
let mime: String = row.get(1)?;
|
||||||
FROM smtp
|
Ok((msg_id, mime))
|
||||||
ORDER BY id"#,
|
})
|
||||||
(),
|
|
||||||
|row| {
|
|
||||||
let msg_id: MsgId = row.get(1)?;
|
|
||||||
let mime: String = row.get(2)?;
|
|
||||||
Ok((msg_id, mime))
|
|
||||||
},
|
|
||||||
)
|
|
||||||
.await
|
.await
|
||||||
.expect("query_row_optional failed")
|
.expect("query_row_optional failed")
|
||||||
.expect("No SMTP row found")
|
.expect("No SMTP row found")
|
||||||
|
|||||||
Reference in New Issue
Block a user