Initial release
[websub-hub] / src / db / postgres / sql / verification-claim-by-id.sql
1 --
2 INSERT INTO verification_in_progress
3 (id, topic_id, callback, claimant, claim_expires)
4 SELECT id, topic_id, callback, $(claimant) AS claimant, now() + $(claimTimeoutSeconds)::text::interval AS claim_expires
5 FROM verification
6 WHERE id = $(verificationId)
7 FOR UPDATE OF verification SKIP LOCKED
8 ON CONFLICT (topic_id, callback) DO UPDATE
9 SET
10 claimant = $(claimant),
11 claimed = now(),
12 claim_expires = now() + $(claimTimeoutSeconds)::text::interval
13 RETURNING id