-- name: GetUserFromId :one
SELECT *
FROM users u
WHERE u.id = $1;

-- name: GetUserAuthValue :one
SELECT u.ID as user_id, a.value as auth_value
FROM users u
    JOIN auth_method a
        ON a.user_id = u.id
WHERE
    (u.name = $1 OR u.email = $1)
    AND a.type = $2;
