Files
mtusi2026lab7/internal/storage/postgres/queries/attachments.sql
T
Vladislav Kunetskiy 1b6e96ccc0
Application / Go invariants and static checks (pull_request) Canceled after 0s
Application / Lab7 verified TLS and retained features (pull_request) Canceled after 0s
Skeleton contracts / contracts (pull_request) Canceled after 0s
lab7: безопасность, mTLS, OpenBao и PKI lifecycle
2026-11-10 14:39:57 +03:00

10 lines
359 B
SQL

-- name: AttachToMessage :exec
INSERT INTO message_attachments (message_id, attachment_id, position)
VALUES (sqlc.arg(message_id), sqlc.arg(attachment_id), sqlc.arg(position));
-- name: ListMessageAttachments :many
SELECT message_id, attachment_id
FROM message_attachments
WHERE message_id = ANY(sqlc.arg(message_ids)::uuid[])
ORDER BY message_id, position;