skeleton/internal/database/sql/queries/confirmation.sql
2020-07-21 22:50:11 +02:00

29 lines
No EOL
522 B
SQL

-- name: CreateEmailConfirmation :one
INSERT INTO "email_confirmation" (
"selector",
"verifier",
"valid_until",
"email_address"
) VALUES (
$1,
$2,
$3,
$4
) RETURNING *;
-- name: GetEmailConfirmationBySelector :one
SELECT
*
FROM "email_confirmation"
WHERE "selector" = $1
LIMIT 1;
-- name: GetEmailConfirmationByAddress :one
SELECT
*
FROM "email_confirmation"
WHERE "email_address" = $1
LIMIT 1;
-- name: DestroyEmailConfirmation :exec
DELETE FROM "email_confirmation" WHERE "email_address" = $1;