skeleton/internal/database/sql/queries/reset.sql

21 lines
460 B
MySQL
Raw Normal View History

2020-07-19 14:08:18 +02:00
-- name: CreateReset :one
INSERT INTO "reset" (
"user_id", "selector", "verifier", "expires_at"
) VALUES (
$1, $2, $3, $4
) RETURNING *;
-- name: DestroyReset :exec
DELETE FROM "reset" WHERE "selector" = $1;
-- name: GetResetBySelector :one
SELECT
"user_id", "selector", "verifier", "expires_at"
FROM "reset"
WHERE "selector" = $1;
-- name: GetResetByUserID :one
SELECT
"user_id", "selector", "verifier", "expires_at"
FROM "reset"
WHERE "user_id" = $1;