2020-07-21 22:50:11 +02:00
|
|
|
-- name: CreateEmailConfirmation :one
|
|
|
|
INSERT INTO "email_confirmation" (
|
|
|
|
"selector",
|
|
|
|
"verifier",
|
|
|
|
"valid_until",
|
|
|
|
"email_address"
|
2020-07-19 14:08:18 +02:00
|
|
|
) VALUES (
|
2020-07-21 22:50:11 +02:00
|
|
|
$1,
|
|
|
|
$2,
|
|
|
|
$3,
|
|
|
|
$4
|
2020-07-19 14:08:18 +02:00
|
|
|
) RETURNING *;
|
|
|
|
|
2020-07-21 22:50:11 +02:00
|
|
|
-- name: GetEmailConfirmationBySelector :one
|
2020-07-19 14:08:18 +02:00
|
|
|
SELECT
|
2020-07-21 22:50:11 +02:00
|
|
|
*
|
|
|
|
FROM "email_confirmation"
|
|
|
|
WHERE "selector" = $1
|
|
|
|
LIMIT 1;
|
2020-07-19 14:08:18 +02:00
|
|
|
|
2020-07-21 22:50:11 +02:00
|
|
|
-- name: GetEmailConfirmationByAddress :one
|
2020-07-19 14:08:18 +02:00
|
|
|
SELECT
|
2020-07-21 22:50:11 +02:00
|
|
|
*
|
|
|
|
FROM "email_confirmation"
|
|
|
|
WHERE "email_address" = $1
|
|
|
|
LIMIT 1;
|
|
|
|
|
|
|
|
-- name: DestroyEmailConfirmation :exec
|
|
|
|
DELETE FROM "email_confirmation" WHERE "email_address" = $1;
|