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

27 lines
No EOL
435 B
SQL

-- name: CreateReset :one
INSERT INTO "password_reset" (
"identity_id",
"selector",
"verifier",
"valid_until"
) VALUES (
$1,
$2,
$3,
$4
) RETURNING *;
-- name: DestroyReset :exec
DELETE FROM "password_reset" WHERE "selector" = $1;
-- name: GetResetBySelector :one
SELECT
*
FROM "password_reset"
WHERE "selector" = $1;
-- name: GetResetByIdentityID :one
SELECT
*
FROM "password_reset"
WHERE "identity_id" = $1;