2025-03-20 19:09:39 +02:00
|
|
|
-- name: InsertWorkspaceAgentDevcontainers :many
|
|
|
|
|
INSERT INTO
|
2026-01-30 17:19:19 +00:00
|
|
|
workspace_agent_devcontainers (workspace_agent_id, created_at, id, name, workspace_folder, config_path, subagent_id)
|
2025-03-20 19:09:39 +02:00
|
|
|
SELECT
|
|
|
|
|
@workspace_agent_id::uuid AS workspace_agent_id,
|
|
|
|
|
@created_at::timestamptz AS created_at,
|
|
|
|
|
unnest(@id::uuid[]) AS id,
|
2025-03-25 14:59:20 +02:00
|
|
|
unnest(@name::text[]) AS name,
|
2025-03-20 19:09:39 +02:00
|
|
|
unnest(@workspace_folder::text[]) AS workspace_folder,
|
2026-01-30 17:19:19 +00:00
|
|
|
unnest(@config_path::text[]) AS config_path,
|
|
|
|
|
NULLIF(unnest(@subagent_id::uuid[]), '00000000-0000-0000-0000-000000000000')::uuid AS subagent_id
|
2025-03-20 19:09:39 +02:00
|
|
|
RETURNING workspace_agent_devcontainers.*;
|
|
|
|
|
|
|
|
|
|
-- name: GetWorkspaceAgentDevcontainersByAgentID :many
|
|
|
|
|
SELECT
|
|
|
|
|
*
|
|
|
|
|
FROM
|
|
|
|
|
workspace_agent_devcontainers
|
|
|
|
|
WHERE
|
|
|
|
|
workspace_agent_id = $1
|
|
|
|
|
ORDER BY
|
|
|
|
|
created_at, id;
|