refactor(db): use int for attachment size and add lookup query

This commit is contained in:
kk10
2026-11-02 21:16:58 +03:00
parent 45c9f7731d
commit 983bbaa55e
9 changed files with 49 additions and 16 deletions
+3 -3
View File
@@ -167,7 +167,7 @@ func (s *MessageService) Create(
if err := q.CreateMessageAttachment(ctx, db.CreateMessageAttachmentParams{
MessageID: id,
AttachmentID: attachmentID,
Position: int32(i),
Position: i,
}); err != nil {
return model.Message{}, err
}
@@ -210,7 +210,7 @@ func (s *MessageService) List(
if cursor == nil {
rows, err = s.q.ListMessagesFirstPage(ctx, db.ListMessagesFirstPageParams{
ChatID: chatID,
Lim: int32(limit + 1),
Lim: limit + 1,
})
} else {
decoded, derr := decodeCursor(*cursor, chatID)
@@ -222,7 +222,7 @@ func (s *MessageService) List(
ChatID: chatID,
AfterCreatedAt: decoded.CreatedAt,
AfterID: decoded.ID,
Lim: int32(limit + 1),
Lim: limit + 1,
})
}
if err != nil {