naise_pos/db/query/users.sql
2023-03-19 18:17:17 +07:00

24 lines
407 B
SQL

-- name: CreateUser :one
INSERT INTO users (
email,
password,
fullname
) VALUES ($1, $2, $3)
RETURNING *;
-- name: GetPasswordByEmail :one
SELECT password
FROM users
WHERE email = $1;
-- name: GetUserById :one
SELECT *
FROM users u
JOIN merchants m on u.id = m.owner_id
WHERE u.id = $1;
-- name: GetUserByEmail :one
SELECT *
FROM users u
JOIN merchants m on u.id = m.owner_id
WHERE email = $1;