MySQL · 686 bytes Raw Blame History
1 -- SPDX-License-Identifier: AGPL-3.0-or-later
2
3 -- name: InsertArtifact :one
4 INSERT INTO workflow_artifacts (run_id, name, object_key, byte_count, expires_at)
5 VALUES ($1, $2, $3, $4, $5)
6 RETURNING id, run_id, name, object_key, byte_count, expires_at, created_at;
7
8 -- name: ListArtifactsForRun :many
9 SELECT id, name, object_key, byte_count, expires_at, created_at
10 FROM workflow_artifacts
11 WHERE run_id = $1
12 ORDER BY name ASC;
13
14 -- name: GetArtifactByID :one
15 SELECT id, run_id, name, object_key, byte_count, expires_at, created_at
16 FROM workflow_artifacts
17 WHERE id = $1;
18
19 -- name: DeleteExpiredArtifacts :many
20 DELETE FROM workflow_artifacts WHERE expires_at < now()
21 RETURNING id, object_key;
22