mirror of
https://github.com/coder/coder.git
synced 2025-07-03 16:13:58 +00:00
In the presence of multiple devcontainers, it would be nice to differentiate them by name. This change inherits the resource name from terraform. Refs #17076
22 lines
627 B
SQL
22 lines
627 B
SQL
-- name: InsertWorkspaceAgentDevcontainers :many
|
|
INSERT INTO
|
|
workspace_agent_devcontainers (workspace_agent_id, created_at, id, name, workspace_folder, config_path)
|
|
SELECT
|
|
@workspace_agent_id::uuid AS workspace_agent_id,
|
|
@created_at::timestamptz AS created_at,
|
|
unnest(@id::uuid[]) AS id,
|
|
unnest(@name::text[]) AS name,
|
|
unnest(@workspace_folder::text[]) AS workspace_folder,
|
|
unnest(@config_path::text[]) AS config_path
|
|
RETURNING workspace_agent_devcontainers.*;
|
|
|
|
-- name: GetWorkspaceAgentDevcontainersByAgentID :many
|
|
SELECT
|
|
*
|
|
FROM
|
|
workspace_agent_devcontainers
|
|
WHERE
|
|
workspace_agent_id = $1
|
|
ORDER BY
|
|
created_at, id;
|