mirror of
https://github.com/coder/coder.git
synced 2025-07-15 22:20:27 +00:00
Use licenses to populate the Entitlements API (#3715)
* 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>
This commit is contained in:
@ -13,6 +13,12 @@ SELECT *
|
||||
FROM licenses
|
||||
ORDER BY (id);
|
||||
|
||||
-- name: GetUnexpiredLicenses :many
|
||||
SELECT *
|
||||
FROM licenses
|
||||
WHERE exp > NOW()
|
||||
ORDER BY (id);
|
||||
|
||||
-- name: DeleteLicense :one
|
||||
DELETE
|
||||
FROM licenses
|
||||
|
@ -28,6 +28,14 @@ SELECT
|
||||
FROM
|
||||
users;
|
||||
|
||||
-- name: GetActiveUserCount :one
|
||||
SELECT
|
||||
COUNT(*)
|
||||
FROM
|
||||
users
|
||||
WHERE
|
||||
status = 'active'::public.user_status;
|
||||
|
||||
-- name: InsertUser :one
|
||||
INSERT INTO
|
||||
users (
|
||||
|
Reference in New Issue
Block a user