mirror of
https://github.com/coder/coder.git
synced 2025-07-06 15:41:45 +00:00
* feat: use app wildcards for apps if configured * feat: relative_path -> subdomain - rename relative_path -> subdomain when referring to apps - migrate workspace_apps.relative_path to workspace_apps.subdomain - upgrade coder/coder terraform module to 0.5.0
39 lines
943 B
SQL
39 lines
943 B
SQL
-- name: GetWorkspaceAppsByAgentID :many
|
|
SELECT * FROM workspace_apps WHERE agent_id = $1 ORDER BY name ASC;
|
|
|
|
-- name: GetWorkspaceAppsByAgentIDs :many
|
|
SELECT * FROM workspace_apps WHERE agent_id = ANY(@ids :: uuid [ ]) ORDER BY name ASC;
|
|
|
|
-- name: GetWorkspaceAppByAgentIDAndName :one
|
|
SELECT * FROM workspace_apps WHERE agent_id = $1 AND name = $2;
|
|
|
|
-- name: GetWorkspaceAppsCreatedAfter :many
|
|
SELECT * FROM workspace_apps WHERE created_at > $1 ORDER BY name ASC;
|
|
|
|
-- name: InsertWorkspaceApp :one
|
|
INSERT INTO
|
|
workspace_apps (
|
|
id,
|
|
created_at,
|
|
agent_id,
|
|
name,
|
|
icon,
|
|
command,
|
|
url,
|
|
subdomain,
|
|
healthcheck_url,
|
|
healthcheck_interval,
|
|
healthcheck_threshold,
|
|
health
|
|
)
|
|
VALUES
|
|
($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12) RETURNING *;
|
|
|
|
-- name: UpdateWorkspaceAppHealthByID :exec
|
|
UPDATE
|
|
workspace_apps
|
|
SET
|
|
health = $2
|
|
WHERE
|
|
id = $1;
|