mirror of
https://github.com/coder/coder.git
synced 2025-07-06 15:41:45 +00:00
* Use licenses for entitlements API Signed-off-by: Spike Curtis <spike@coder.com> * Tests for entitlements API Signed-off-by: Spike Curtis <spike@coder.com> * Add commentary about FeatureService Signed-off-by: Spike Curtis <spike@coder.com> * Lint Signed-off-by: Spike Curtis <spike@coder.com> * Quiet down the logs Signed-off-by: Spike Curtis <spike@coder.com> * Tell revive it's ok Signed-off-by: Spike Curtis <spike@coder.com> Signed-off-by: Spike Curtis <spike@coder.com>
27 lines
350 B
SQL
27 lines
350 B
SQL
-- name: InsertLicense :one
|
|
INSERT INTO
|
|
licenses (
|
|
uploaded_at,
|
|
jwt,
|
|
exp
|
|
)
|
|
VALUES
|
|
($1, $2, $3) RETURNING *;
|
|
|
|
-- name: GetLicenses :many
|
|
SELECT *
|
|
FROM licenses
|
|
ORDER BY (id);
|
|
|
|
-- name: GetUnexpiredLicenses :many
|
|
SELECT *
|
|
FROM licenses
|
|
WHERE exp > NOW()
|
|
ORDER BY (id);
|
|
|
|
-- name: DeleteLicense :one
|
|
DELETE
|
|
FROM licenses
|
|
WHERE id = $1
|
|
RETURNING id;
|