2022-08-22 15:02:50 -07:00
|
|
|
-- name: InsertLicense :one
|
|
|
|
|
INSERT INTO
|
|
|
|
|
licenses (
|
|
|
|
|
uploaded_at,
|
|
|
|
|
jwt,
|
2022-11-16 17:09:49 -06:00
|
|
|
exp,
|
|
|
|
|
uuid
|
2022-08-22 15:02:50 -07:00
|
|
|
)
|
|
|
|
|
VALUES
|
2022-11-16 17:09:49 -06:00
|
|
|
($1, $2, $3, $4) RETURNING *;
|
2022-08-24 11:44:22 -07:00
|
|
|
|
|
|
|
|
-- name: GetLicenses :many
|
|
|
|
|
SELECT *
|
|
|
|
|
FROM licenses
|
|
|
|
|
ORDER BY (id);
|
2022-08-25 14:04:31 -07:00
|
|
|
|
2022-08-29 16:45:40 -07:00
|
|
|
-- name: GetUnexpiredLicenses :many
|
|
|
|
|
SELECT *
|
|
|
|
|
FROM licenses
|
|
|
|
|
WHERE exp > NOW()
|
|
|
|
|
ORDER BY (id);
|
|
|
|
|
|
2022-08-25 14:04:31 -07:00
|
|
|
-- name: DeleteLicense :one
|
|
|
|
|
DELETE
|
|
|
|
|
FROM licenses
|
|
|
|
|
WHERE id = $1
|
|
|
|
|
RETURNING id;
|