Durable staging handoff, transactional outbox, at-least-once worker with lease fencing, idempotent versioned pipeline, three variants, operator tooling, contract tests and evidence. Includes the review fixes: reprocess source selection and failure settlement, replay guards, stale-job retirement, PNG structural/raster validation, migration rollback safety and audit events.
10 lines
359 B
SQL
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;
|