stillbox/sql/postgres/query.sql
2024-07-14 17:39:03 -04:00

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 *;