Serialize uid

This commit is contained in:
link2xt
2024-04-06 15:54:12 +00:00
parent 60a7bbc9b5
commit 12ba33d9d4
2 changed files with 11 additions and 1 deletions

View File

@@ -1074,9 +1074,11 @@ VALUES (:id,
INSERT INTO
msgs_status_updates (id,
msg_id,
uid,
update_item)
VALUES (:id,
:msg_id,
:uid
:update_item)",
)?;
@@ -1089,6 +1091,9 @@ VALUES (:id,
self.expect_key("msg_id").await?;
let msg_id = self.expect_i64().await?;
self.expect_key("uid").await?;
let uid = self.expect_string().await?;
self.expect_key("update_item").await?;
let update_item = self.expect_u32().await?;
@@ -1097,6 +1102,7 @@ VALUES (:id,
stmt.execute(named_params! {
":id": id,
":msg_id": msg_id,
":uid": uid,
":update_item": update_item,
})?;
}

View File

@@ -726,13 +726,14 @@ impl<'a, W: AsyncWrite + Unpin> Encoder<'a, W> {
async fn serialize_msgs_status_updates(&mut self) -> Result<()> {
let mut stmt = self
.tx
.prepare("SELECT id, msg_id, update_item FROM msgs_status_updates")?;
.prepare("SELECT id, msg_id, uid, update_item FROM msgs_status_updates")?;
let mut rows = stmt.query(())?;
self.w.write_all(b"l").await?;
while let Some(row) = rows.next()? {
let id: i64 = row.get("id")?;
let msg_id: i64 = row.get("msg_id")?;
let uid: String = row.get("uid")?;
let update_item: String = row.get("update_item")?;
self.w.write_all(b"d").await?;
@@ -743,6 +744,9 @@ impl<'a, W: AsyncWrite + Unpin> Encoder<'a, W> {
write_str(&mut self.w, "msg_id").await?;
write_i64(&mut self.w, msg_id).await?;
write_str(&mut self.w, "uid").await?;
write_str(&mut self.w, &uid).await?;
write_str(&mut self.w, "update_item").await?;
write_str(&mut self.w, &update_item).await?;