-- name: CreateUser :one
INSERT INTO users (created_at, updated_at, name, api_key)
VALUES (?, ?, ?, lower(hex(randomblob(256))))
RETURNING *;

-- name: GetUserByAPIKey :one
SELECT * FROM users WHERE api_key = ?;
