-- users.sql
-- name: CreateUser :one
INSERT INTO users (id, user_name, user_mail, password) VALUES ($1, $2, $3, $4) RETURNING id;

-- name: UpdateUser :exec
UPDATE users SET user_name = $2, user_mail = $3, password = $4 WHERE id = $1;

-- name: GetUsernameByID :one
SELECT user_name FROM users WHERE id = $1;

-- name: GetUserByID :one
SELECT id, user_name, user_mail, created_at FROM users WHERE id = $1;

-- name: GetUserAuthByEmail :one
SELECT id, user_name, user_mail, password
FROM users
WHERE user_mail = $1;
