28 lines
425 B
SQL
28 lines
425 B
SQL
-- name: GetUserByEmail :one
|
|
SELECT * FROM users
|
|
WHERE email = lower(?)
|
|
LIMIT 1;
|
|
|
|
-- name: GetUserByID :one
|
|
SELECT * FROM users
|
|
WHERE id = ?
|
|
LIMIT 1;
|
|
|
|
-- name: CreateUser :one
|
|
INSERT INTO users (
|
|
name, email, password
|
|
) VALUES (
|
|
?, ?, ?
|
|
) RETURNING *;
|
|
|
|
-- name: UpdateUserPassword :exec
|
|
UPDATE users
|
|
SET password = ?
|
|
WHERE id = ?;
|
|
|
|
-- name: UpdateUserSetVerified :exec
|
|
UPDATE users
|
|
SET verified = 1
|
|
WHERE email = ?;
|
|
|