tulip/database/queries/manage-users.sql

28 lines
522 B
MySQL
Raw Normal View History

-- name: GetUserList :many
SELECT subject,
name,
username,
picture,
2024-05-13 20:25:44 +01:00
website,
email,
email_verified,
role,
updated_at,
active
FROM users
LIMIT 25 OFFSET ?;
-- name: UpdateUserRole :exec
UPDATE users
SET active = ?,
role=?
WHERE subject = ?;
-- name: VerifyUserEmail :exec
UPDATE users
SET email_verified = 1
WHERE subject = ?;
-- name: UserEmailExists :one
2024-05-13 20:25:44 +01:00
SELECT EXISTS(SELECT 1 FROM users WHERE email = ? AND email_verified = 1) == 1 AS email_exists;