2024-05-17 21:40:31 +01:00
|
|
|
-- name: GetClientInfo :one
|
|
|
|
SELECT *
|
|
|
|
FROM client_store
|
|
|
|
WHERE subject = ?
|
|
|
|
LIMIT 1;
|
|
|
|
|
|
|
|
-- name: GetAppList :many
|
2024-09-02 22:54:03 +01:00
|
|
|
SELECT subject,
|
|
|
|
name,
|
|
|
|
domain,
|
|
|
|
owner_subject,
|
|
|
|
perms,
|
|
|
|
public,
|
|
|
|
sso,
|
|
|
|
active
|
2024-05-17 21:40:31 +01:00
|
|
|
FROM client_store
|
2024-09-02 22:54:03 +01:00
|
|
|
WHERE owner_subject = ?
|
2024-10-05 21:08:02 +01:00
|
|
|
OR CAST(? AS BOOLEAN) = 1
|
2024-05-17 21:40:31 +01:00
|
|
|
LIMIT 25 OFFSET ?;
|
|
|
|
|
|
|
|
-- name: InsertClientApp :exec
|
2024-09-02 22:54:03 +01:00
|
|
|
INSERT INTO client_store (subject, name, secret, domain, perms, public, sso, active, owner_subject)
|
2024-05-17 21:40:31 +01:00
|
|
|
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?);
|
|
|
|
|
|
|
|
-- name: UpdateClientApp :exec
|
|
|
|
UPDATE client_store
|
|
|
|
SET name = ?,
|
|
|
|
domain = ?,
|
|
|
|
perms = CASE WHEN CAST(? AS BOOLEAN) = true THEN ? ELSE perms END,
|
|
|
|
public = ?,
|
|
|
|
sso = ?,
|
|
|
|
active = ?
|
|
|
|
WHERE subject = ?
|
2024-09-02 22:54:03 +01:00
|
|
|
AND owner_subject = ?;
|
2024-05-17 21:40:31 +01:00
|
|
|
|
|
|
|
-- name: ResetClientAppSecret :exec
|
|
|
|
UPDATE client_store
|
|
|
|
SET secret = ?
|
|
|
|
WHERE subject = ?
|
2024-09-02 22:54:03 +01:00
|
|
|
AND owner_subject = ?;
|