-- name: GetUserByUsername :one
SELECT * FROM users
WHERE email = $1;

-- name: GetUser :one
SELECT * FROM users
WHERE id = $1;

-- name: CreateUser :one
INSERT INTO users
(email, name, password)
VALUES ($1, $2, $3)
RETURNING *;

-- name: UpdateLastLogin :one
UPDATE users
SET last_login = NOW()
WHERE users.id = $1
RETURNING *;