-- name: GetByPhoneNumber :one
SELECT *
FROM users
WHERE phone_number = $1
LIMIT 1;

-- name: GetUserByUUID :one
SELECT *
FROM users
WHERE uuid = $1
LIMIT 1;

-- name: CreateUser :one
INSERT INTO users (phone_number)
VALUES ($1)
RETURNING *;

-- name: UpdateUserVerified :one
UPDATE users
SET verified    = TRUE,
    verified_at = CURRENT_TIMESTAMP
WHERE uuid = $1
RETURNING *;
