Files
coder/coderd/database/queries/workspacebuilds.sql
T
Steven Masley 8b125d6c5d chore: Implement joins with golang templates (#6429)
* feat: Implement view for workspace builds to include rbac info

* Removes the need to fetch the workspace to run an rbac check.
* chore: Use workspace build as RBAC object
* chore: Use golang templates instead of sqlc files
2023-03-10 09:44:38 -06:00

40 lines
631 B
SQL

-- name: InsertWorkspaceBuild :one
INSERT INTO
workspace_builds (
id,
created_at,
updated_at,
workspace_id,
template_version_id,
"build_number",
transition,
initiator_id,
job_id,
provisioner_state,
deadline,
max_deadline,
reason
)
VALUES
($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13) RETURNING *;
-- name: UpdateWorkspaceBuildByID :one
UPDATE
workspace_builds
SET
updated_at = $2,
provisioner_state = $3,
deadline = $4,
max_deadline = $5
WHERE
id = $1 RETURNING *;
-- name: UpdateWorkspaceBuildCostByID :one
UPDATE
workspace_builds
SET
daily_cost = $2
WHERE
id = $1 RETURNING *;