saasitone/db/queries/users.sql

28 lines
425 B
MySQL
Raw Permalink Normal View History

2024-07-11 21:09:15 -07:00
-- 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 = ?;