mirror of
https://github.com/coder/coder.git
synced 2025-07-15 22:20:27 +00:00
feat: Add backend API support for resource metadata (#3242)
* Initial support for metadata in provisioner API and Terraform provisioner * add support for nullable metadata fields * handle metadata fields in provisionerd and API
This commit is contained in:
@ -22,3 +22,25 @@ INSERT INTO
|
||||
workspace_resources (id, created_at, job_id, transition, type, name)
|
||||
VALUES
|
||||
($1, $2, $3, $4, $5, $6) RETURNING *;
|
||||
|
||||
-- name: GetWorkspaceResourceMetadataByResourceID :many
|
||||
SELECT
|
||||
*
|
||||
FROM
|
||||
workspace_resource_metadata
|
||||
WHERE
|
||||
workspace_resource_id = $1;
|
||||
|
||||
-- name: GetWorkspaceResourceMetadataByResourceIDs :many
|
||||
SELECT
|
||||
*
|
||||
FROM
|
||||
workspace_resource_metadata
|
||||
WHERE
|
||||
workspace_resource_id = ANY(@ids :: uuid [ ]);
|
||||
|
||||
-- name: InsertWorkspaceResourceMetadata :one
|
||||
INSERT INTO
|
||||
workspace_resource_metadata (workspace_resource_id, key, value, sensitive)
|
||||
VALUES
|
||||
($1, $2, $3, $4) RETURNING *;
|
||||
|
Reference in New Issue
Block a user