Files
coder/coderd/database/queries/workspaceresources.sql
T
Kyle Carberry 19b4323512 feat: Allow workspace resources to attach multiple agents (#942)
This enables a "kubernetes_pod" to attach multiple agents that
could be for multiple services. Each agent is required to have
a unique name, so SSH syntax is:

`coder ssh <workspace>.<agent>`

A resource can have zero agents too, they aren't required.
2022-04-11 16:06:15 -05:00

30 lines
389 B
SQL

-- name: GetWorkspaceResourceByID :one
SELECT
*
FROM
workspace_resources
WHERE
id = $1;
-- name: GetWorkspaceResourcesByJobID :many
SELECT
*
FROM
workspace_resources
WHERE
job_id = $1;
-- name: InsertWorkspaceResource :one
INSERT INTO
workspace_resources (
id,
created_at,
job_id,
transition,
address,
type,
name
)
VALUES
($1, $2, $3, $4, $5, $6, $7) RETURNING *;