1-- name: CreateAuthCode :exec
2INSERT INTO
3 auth_code (token, creator_id)
4VALUES
5 (?, ?);
6
7-- name: GetAuthCodeByToken :one
8SELECT
9 auth_code.id,
10 auth_code.token,
11 auth_code.creator_id,
12 auth_code.used
13FROM
14 auth_code
15WHERE
16 auth_code.token = ?;
17
18-- name: UpdateAuthCodeAsUsed :exec
19UPDATE auth_code
20SET
21 used = TRUE
22WHERE
23 id = ?;