chore: split queries.sql into files by table (#762)

This commit is contained in:
Colin Adler
2022-04-01 15:45:23 -05:00
committed by GitHub
parent 2b1a0ee126
commit fd523100bf
27 changed files with 2816 additions and 2770 deletions
+42
View File
@@ -0,0 +1,42 @@
-- name: GetUserByID :one
SELECT
*
FROM
users
WHERE
id = $1
LIMIT
1;
-- name: GetUserByEmailOrUsername :one
SELECT
*
FROM
users
WHERE
LOWER(username) = LOWER(@username)
OR email = @email
LIMIT
1;
-- name: GetUserCount :one
SELECT
COUNT(*)
FROM
users;
-- name: InsertUser :one
INSERT INTO
users (
id,
email,
"name",
login_type,
revoked,
hashed_password,
created_at,
updated_at,
username
)
VALUES
($1, $2, $3, $4, FALSE, $5, $6, $7, $8) RETURNING *;