19 lines
327 B
SQL
19 lines
327 B
SQL
-- name: GetUserByID :one
|
|
SELECT * FROM users
|
|
WHERE id = $1 LIMIT 1;
|
|
|
|
-- name: GetUserByUsername :one
|
|
SELECT * FROM users
|
|
WHERE username = $1 LIMIT 1;
|
|
|
|
-- name: GetUsers :many
|
|
SELECT * FROM users;
|
|
|
|
-- name: CreateUser :one
|
|
INSERT INTO users (
|
|
username,
|
|
password,
|
|
email,
|
|
is_admin
|
|
) VALUES ($1, $2, $3, $4)
|
|
RETURNING *;
|