| 1 | // Code generated by sqlc. DO NOT EDIT. |
| 2 | // versions: |
| 3 | // sqlc v1.31.1 |
| 4 | // source: workflow_job_secret_masks.sql |
| 5 | |
| 6 | package actionsdb |
| 7 | |
| 8 | import ( |
| 9 | "context" |
| 10 | ) |
| 11 | |
| 12 | const getWorkflowJobSecretMask = `-- name: GetWorkflowJobSecretMask :one |
| 13 | SELECT job_id, ciphertext, nonce, created_at |
| 14 | FROM workflow_job_secret_masks |
| 15 | WHERE job_id = $1 |
| 16 | ` |
| 17 | |
| 18 | func (q *Queries) GetWorkflowJobSecretMask(ctx context.Context, db DBTX, jobID int64) (WorkflowJobSecretMask, error) { |
| 19 | row := db.QueryRow(ctx, getWorkflowJobSecretMask, jobID) |
| 20 | var i WorkflowJobSecretMask |
| 21 | err := row.Scan( |
| 22 | &i.JobID, |
| 23 | &i.Ciphertext, |
| 24 | &i.Nonce, |
| 25 | &i.CreatedAt, |
| 26 | ) |
| 27 | return i, err |
| 28 | } |
| 29 | |
| 30 | const upsertWorkflowJobSecretMask = `-- name: UpsertWorkflowJobSecretMask :exec |
| 31 | |
| 32 | INSERT INTO workflow_job_secret_masks (job_id, ciphertext, nonce) |
| 33 | VALUES ($1, $2, $3) |
| 34 | ON CONFLICT (job_id) DO UPDATE |
| 35 | SET ciphertext = EXCLUDED.ciphertext, |
| 36 | nonce = EXCLUDED.nonce, |
| 37 | created_at = now() |
| 38 | ` |
| 39 | |
| 40 | type UpsertWorkflowJobSecretMaskParams struct { |
| 41 | JobID int64 |
| 42 | Ciphertext []byte |
| 43 | Nonce []byte |
| 44 | } |
| 45 | |
| 46 | // SPDX-License-Identifier: AGPL-3.0-or-later |
| 47 | func (q *Queries) UpsertWorkflowJobSecretMask(ctx context.Context, db DBTX, arg UpsertWorkflowJobSecretMaskParams) error { |
| 48 | _, err := db.Exec(ctx, upsertWorkflowJobSecretMask, arg.JobID, arg.Ciphertext, arg.Nonce) |
| 49 | return err |
| 50 | } |
| 51 |