skeleton/internal/database/sql/queries/confirmation.sql

21 lines
608 B
MySQL
Raw Normal View History

2020-07-19 14:08:18 +02:00
-- name: CreateConfirmation :one
INSERT INTO "public"."confirmation" (
"email_address", "user_id", "selector", "verifier", "expires_at"
) VALUES (
$1, $2, $3, $4, $5
) RETURNING *;
-- name: DestroyConfirmation :exec
DELETE FROM "public"."confirmation" WHERE "selector" = $1;
-- name: GetConfirmationBySelector :one
SELECT
"email_address", "user_id", "selector", "verifier", "expires_at"
FROM "public"."confirmation"
WHERE "selector" = $1;
-- name: GetConfirmationByUserID :one
SELECT
"email_address", "user_id", "selector", "verifier", "expires_at"
FROM "public"."confirmation"
WHERE "user_id" = $1;