taskcafe/api/query/user_accounts.sql
2020-06-23 15:20:53 -05:00

20 lines
615 B
SQL

-- name: GetUserAccountByID :one
SELECT * FROM user_account WHERE user_id = $1;
-- name: GetAllUserAccounts :many
SELECT * FROM user_account;
-- name: GetUserAccountByUsername :one
SELECT * FROM user_account WHERE username = $1;
-- name: CreateUserAccount :one
INSERT INTO user_account(full_name, initials, email, username, created_at, password_hash)
VALUES ($1, $2, $3, $4, $5, $6) RETURNING *;
-- name: UpdateUserAccountProfileAvatarURL :one
UPDATE user_account SET profile_avatar_url = $2 WHERE user_id = $1
RETURNING *;
-- name: DeleteUserAccountByID :exec
DELETE FROM user_account WHERE user_id = $1;