Go · 11024 bytes Raw Blame History
1 // Code generated by sqlc. DO NOT EDIT.
2 // versions:
3 // sqlc v1.31.1
4
5 package actionsdb
6
7 import (
8 "context"
9
10 "github.com/jackc/pgx/v5/pgtype"
11 )
12
13 type Querier interface {
14 // SPDX-License-Identifier: AGPL-3.0-or-later
15 AppendStepLogChunk(ctx context.Context, db DBTX, arg AppendStepLogChunkParams) (AppendStepLogChunkRow, error)
16 CancelOpenWorkflowStepsForJob(ctx context.Context, db DBTX, jobID int64) ([]WorkflowStep, error)
17 ClaimQueuedWorkflowJob(ctx context.Context, db DBTX, arg ClaimQueuedWorkflowJobParams) (ClaimQueuedWorkflowJobRow, error)
18 CompleteWorkflowRun(ctx context.Context, db DBTX, arg CompleteWorkflowRunParams) (WorkflowRun, error)
19 CountRunningJobsForRunner(ctx context.Context, db DBTX, runnerID int64) (int32, error)
20 CountWorkflowRunsForRepo(ctx context.Context, db DBTX, arg CountWorkflowRunsForRepoParams) (int64, error)
21 DeleteOldRunnerJWTUsesForCleanup(ctx context.Context, db DBTX, expiresAt pgtype.Timestamptz) (int64, error)
22 DeleteOldWorkflowRunsForCleanup(ctx context.Context, db DBTX, completedAt pgtype.Timestamptz) (int64, error)
23 DeleteOrgSecret(ctx context.Context, db DBTX, arg DeleteOrgSecretParams) error
24 DeleteOrgVariable(ctx context.Context, db DBTX, arg DeleteOrgVariableParams) error
25 DeleteRepoSecret(ctx context.Context, db DBTX, arg DeleteRepoSecretParams) error
26 DeleteRepoVariable(ctx context.Context, db DBTX, arg DeleteRepoVariableParams) error
27 DeleteStaleStepLogChunksForCleanup(ctx context.Context, db DBTX, completedAt pgtype.Timestamptz) (int64, error)
28 DeleteStepLogChunks(ctx context.Context, db DBTX, stepID int64) error
29 DeleteWorkflowArtifactByID(ctx context.Context, db DBTX, id int64) (int64, error)
30 DeleteWorkflowArtifactsByIDs(ctx context.Context, db DBTX, dollar_1 []int64) (int64, error)
31 // Cascades to workflow_jobs → workflow_steps → workflow_step_log_chunks
32 // and workflow_artifacts via the on-delete-cascade FK chain. The
33 // S3-side artifact blobs are NOT removed here; the handler queries
34 // the artifact object_keys first and deletes them best-effort after
35 // the row is gone.
36 DeleteWorkflowRunByID(ctx context.Context, db DBTX, id int64) (int64, error)
37 // Idempotent: re-disabling an already-disabled workflow is a no-op
38 // and does not bump disabled_at.
39 DisableWorkflow(ctx context.Context, db DBTX, arg DisableWorkflowParams) error
40 // Returns affected-rows so the handler can distinguish 200 (re-enabled)
41 // from 404-ish no-op.
42 EnableWorkflow(ctx context.Context, db DBTX, arg EnableWorkflowParams) (int64, error)
43 // Idempotent insert: if a row with the same (repo_id, workflow_file,
44 // trigger_event_id) already exists, returns no rows (pgx.ErrNoRows in
45 // Go). The handler treats that as a successful no-op so worker
46 // retries and admin replays of the same triggering event don't
47 // duplicate runs.
48 //
49 // The ON CONFLICT predicate matches the partial unique index defined
50 // in migration 0051; both must agree for postgres to infer the
51 // target.
52 EnqueueWorkflowRun(ctx context.Context, db DBTX, arg EnqueueWorkflowRunParams) (WorkflowRun, error)
53 GetArtifactByID(ctx context.Context, db DBTX, id int64) (WorkflowArtifact, error)
54 GetFirstStepForJob(ctx context.Context, db DBTX, jobID int64) (WorkflowStep, error)
55 GetOrgSecret(ctx context.Context, db DBTX, arg GetOrgSecretParams) (GetOrgSecretRow, error)
56 GetOrgVariable(ctx context.Context, db DBTX, arg GetOrgVariableParams) (GetOrgVariableRow, error)
57 GetRepoSecret(ctx context.Context, db DBTX, arg GetRepoSecretParams) (GetRepoSecretRow, error)
58 GetRepoVariable(ctx context.Context, db DBTX, arg GetRepoVariableParams) (GetRepoVariableRow, error)
59 GetRunnerByID(ctx context.Context, db DBTX, id int64) (WorkflowRunner, error)
60 GetRunnerByName(ctx context.Context, db DBTX, name string) (WorkflowRunner, error)
61 GetRunnerByTokenHash(ctx context.Context, db DBTX, tokenHash []byte) (GetRunnerByTokenHashRow, error)
62 GetStepLogChunkBefore(ctx context.Context, db DBTX, arg GetStepLogChunkBeforeParams) (WorkflowStepLogChunk, error)
63 GetStepLogChunkByStepSeq(ctx context.Context, db DBTX, arg GetStepLogChunkByStepSeqParams) (WorkflowStepLogChunk, error)
64 GetWorkflowJobByID(ctx context.Context, db DBTX, id int64) (WorkflowJob, error)
65 GetWorkflowJobSecretMask(ctx context.Context, db DBTX, jobID int64) (WorkflowJobSecretMask, error)
66 GetWorkflowRunByID(ctx context.Context, db DBTX, id int64) (WorkflowRun, error)
67 GetWorkflowRunForRepoByIndex(ctx context.Context, db DBTX, arg GetWorkflowRunForRepoByIndexParams) (GetWorkflowRunForRepoByIndexRow, error)
68 GetWorkflowStepByID(ctx context.Context, db DBTX, id int64) (WorkflowStep, error)
69 HeartbeatRunner(ctx context.Context, db DBTX, arg HeartbeatRunnerParams) (WorkflowRunner, error)
70 // SPDX-License-Identifier: AGPL-3.0-or-later
71 InsertArtifact(ctx context.Context, db DBTX, arg InsertArtifactParams) (WorkflowArtifact, error)
72 // SPDX-License-Identifier: AGPL-3.0-or-later
73 InsertRunner(ctx context.Context, db DBTX, arg InsertRunnerParams) (WorkflowRunner, error)
74 InsertRunnerToken(ctx context.Context, db DBTX, arg InsertRunnerTokenParams) (RunnerToken, error)
75 // SPDX-License-Identifier: AGPL-3.0-or-later
76 InsertWorkflowJob(ctx context.Context, db DBTX, arg InsertWorkflowJobParams) (WorkflowJob, error)
77 // SPDX-License-Identifier: AGPL-3.0-or-later
78 InsertWorkflowRun(ctx context.Context, db DBTX, arg InsertWorkflowRunParams) (WorkflowRun, error)
79 // SPDX-License-Identifier: AGPL-3.0-or-later
80 InsertWorkflowStep(ctx context.Context, db DBTX, arg InsertWorkflowStepParams) (WorkflowStep, error)
81 // SPDX-License-Identifier: AGPL-3.0-or-later
82 // Hot path for trigger.Enqueue: skip enqueueing when the row exists.
83 IsWorkflowDisabled(ctx context.Context, db DBTX, arg IsWorkflowDisabledParams) (bool, error)
84 ListActiveWorkflowRunsForAdmin(ctx context.Context, db DBTX, arg ListActiveWorkflowRunsForAdminParams) ([]WorkflowRun, error)
85 ListAllStepLogChunksForStep(ctx context.Context, db DBTX, stepID int64) ([]WorkflowStepLogChunk, error)
86 // Used by the run-delete REST handler to drive a best-effort S3
87 // cleanup after the workflow_runs row (and its cascaded
88 // workflow_artifacts rows) have been removed.
89 ListArtifactObjectKeysForRun(ctx context.Context, db DBTX, runID int64) ([]string, error)
90 ListArtifactsForRun(ctx context.Context, db DBTX, runID int64) ([]ListArtifactsForRunRow, error)
91 // Older queued/running runs with the same group block the new run while they
92 // still have at least one queued/running job that has not already received a
93 // cancel request. cancel-in-progress releases the slot by flipping that job
94 // flag even if the runner is still draining the old container.
95 ListBlockingConcurrencyRunsForUpdate(ctx context.Context, db DBTX, arg ListBlockingConcurrencyRunsForUpdateParams) ([]WorkflowRun, error)
96 // Used by the workflows-list endpoint to mark `state: "disabled"`
97 // entries without round-tripping through Is for every file.
98 ListDisabledWorkflowsForRepo(ctx context.Context, db DBTX, repoID int64) ([]string, error)
99 ListExpiredWorkflowArtifactsForCleanup(ctx context.Context, db DBTX, arg ListExpiredWorkflowArtifactsForCleanupParams) ([]ListExpiredWorkflowArtifactsForCleanupRow, error)
100 ListJobsForRun(ctx context.Context, db DBTX, runID int64) ([]ListJobsForRunRow, error)
101 ListOrgSecrets(ctx context.Context, db DBTX, orgID pgtype.Int8) ([]ListOrgSecretsRow, error)
102 ListOrgVariables(ctx context.Context, db DBTX, orgID pgtype.Int8) ([]ListOrgVariablesRow, error)
103 ListQueuedWorkflowJobRunsOn(ctx context.Context, db DBTX) ([]ListQueuedWorkflowJobRunsOnRow, error)
104 ListRepoSecrets(ctx context.Context, db DBTX, repoID pgtype.Int8) ([]ListRepoSecretsRow, error)
105 ListRepoVariables(ctx context.Context, db DBTX, repoID pgtype.Int8) ([]ListRepoVariablesRow, error)
106 ListRunnerStepsForJob(ctx context.Context, db DBTX, jobID int64) ([]ListRunnerStepsForJobRow, error)
107 ListRunners(ctx context.Context, db DBTX) ([]ListRunnersRow, error)
108 ListStepLogChunks(ctx context.Context, db DBTX, arg ListStepLogChunksParams) ([]WorkflowStepLogChunk, error)
109 ListStepsForJob(ctx context.Context, db DBTX, jobID int64) ([]ListStepsForJobRow, error)
110 ListWorkflowRunWorkflowsForRepo(ctx context.Context, db DBTX, repoID int64) ([]ListWorkflowRunWorkflowsForRepoRow, error)
111 ListWorkflowRunsForRepo(ctx context.Context, db DBTX, arg ListWorkflowRunsForRepoParams) ([]ListWorkflowRunsForRepoRow, error)
112 LockRunnerByID(ctx context.Context, db DBTX, id int64) (WorkflowRunner, error)
113 // Companion to EnqueueWorkflowRun for the conflict path: when an
114 // INSERT ... ON CONFLICT DO NOTHING returns no rows, the trigger
115 // handler uses this to find the existing row so it can surface a
116 // stable RunID. Matches the partial-unique index from migration 0051.
117 LookupWorkflowRunByTriggerEvent(ctx context.Context, db DBTX, arg LookupWorkflowRunByTriggerEventParams) (WorkflowRun, error)
118 // SPDX-License-Identifier: AGPL-3.0-or-later
119 MarkRunnerJWTUsed(ctx context.Context, db DBTX, arg MarkRunnerJWTUsedParams) (RunnerJwtUsed, error)
120 MarkWorkflowRunRunning(ctx context.Context, db DBTX, id int64) error
121 // Atomic next-index emitter: take the max + 1 for this repo. Pairs
122 // with the (repo_id, run_index) UNIQUE so concurrent inserts that
123 // race here will catch a unique-violation and the caller retries.
124 // Cast to bigint so sqlc generates int64 (the column type) rather
125 // than int32 (the type the +1 literal would default to).
126 NextRunIndexForRepo(ctx context.Context, db DBTX, repoID int64) (int64, error)
127 RequestWorkflowJobCancel(ctx context.Context, db DBTX, id int64) (WorkflowJob, error)
128 RequestWorkflowRunCancel(ctx context.Context, db DBTX, runID int64) ([]WorkflowJob, error)
129 RevokeAllTokensForRunner(ctx context.Context, db DBTX, runnerID int64) error
130 StartWorkflowRun(ctx context.Context, db DBTX, id int64) (WorkflowRun, error)
131 TouchRunnerHeartbeat(ctx context.Context, db DBTX, arg TouchRunnerHeartbeatParams) error
132 UpdateStepLogChunk(ctx context.Context, db DBTX, arg UpdateStepLogChunkParams) error
133 UpdateWorkflowJobStatus(ctx context.Context, db DBTX, arg UpdateWorkflowJobStatusParams) (WorkflowJob, error)
134 UpdateWorkflowStepLogObject(ctx context.Context, db DBTX, arg UpdateWorkflowStepLogObjectParams) (WorkflowStep, error)
135 UpdateWorkflowStepStatus(ctx context.Context, db DBTX, arg UpdateWorkflowStepStatusParams) (WorkflowStep, error)
136 UpsertOrgSecret(ctx context.Context, db DBTX, arg UpsertOrgSecretParams) (WorkflowSecret, error)
137 UpsertOrgVariable(ctx context.Context, db DBTX, arg UpsertOrgVariableParams) (ActionsVariable, error)
138 // SPDX-License-Identifier: AGPL-3.0-or-later
139 UpsertRepoSecret(ctx context.Context, db DBTX, arg UpsertRepoSecretParams) (WorkflowSecret, error)
140 // SPDX-License-Identifier: AGPL-3.0-or-later
141 UpsertRepoVariable(ctx context.Context, db DBTX, arg UpsertRepoVariableParams) (ActionsVariable, error)
142 // SPDX-License-Identifier: AGPL-3.0-or-later
143 UpsertWorkflowJobSecretMask(ctx context.Context, db DBTX, arg UpsertWorkflowJobSecretMaskParams) error
144 }
145
146 var _ Querier = (*Queries)(nil)
147