go-project-template/db/queries/users.sql

9 lines
234 B
MySQL
Raw Permalink Normal View History

2024-07-25 05:13:23 +00:00
-- name: GetUser :one
SELECT * FROM users WHERE id = $1 LIMIT 1;
-- name: GetUserByIDP :one
SELECT * FROM users WHERE idp_sub = $1 LIMIT 1;
-- name: CreateUser :one
INSERT INTO users (username, idp_sub) VALUES ($1, $2) RETURNING *;