feat: Implement experiment gated CRUD for workspace proxies (#6928)

* feat: Implement basic moon crud
* chore: Implement enterprise endpoints for moons
This commit is contained in:
Steven Masley
2023-04-04 15:07:29 -05:00
committed by GitHub
parent 385a4262e2
commit b4afbe7720
33 changed files with 1327 additions and 7 deletions
+57
View File
@@ -0,0 +1,57 @@
-- name: InsertWorkspaceProxy :one
INSERT INTO
workspace_proxies (
id,
name,
display_name,
icon,
url,
wildcard_hostname,
created_at,
updated_at,
deleted
)
VALUES
($1, $2, $3, $4, $5, $6, $7, $8, false) RETURNING *;
-- name: UpdateWorkspaceProxy :one
UPDATE
workspace_proxies
SET
name = @name,
display_name = @display_name,
url = @url,
wildcard_hostname = @wildcard_hostname,
icon = @icon,
updated_at = Now()
WHERE
id = @id
RETURNING *;
-- name: UpdateWorkspaceProxyDeleted :exec
UPDATE
workspace_proxies
SET
updated_at = Now(),
deleted = @deleted
WHERE
id = @id;
-- name: GetWorkspaceProxyByID :one
SELECT
*
FROM
workspace_proxies
WHERE
id = $1
LIMIT
1;
-- name: GetWorkspaceProxies :many
SELECT
*
FROM
workspace_proxies
WHERE
deleted = false;