forked from mtusi2026/mtusi2026lab4
ЛР 4: вложения в S3 и двусторонняя сверка хранилищ
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
-- name: CreateMessagesAttachments :execrows
|
||||
INSERT INTO messages_attachments (message_id, attachment_id, chat_id, position)
|
||||
SELECT $1, $2, $3, $4
|
||||
FROM attachments
|
||||
WHERE id = $2 AND chat_id = $3;
|
||||
|
||||
-- name: GetMessagesAttachments :many
|
||||
SELECT attachment_id, position
|
||||
FROM messages_attachments
|
||||
WHERE message_id = sqlc.arg(message_id)
|
||||
ORDER BY position ASC;
|
||||
Reference in New Issue
Block a user