Go · 9185 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 DeleteWorkflowArtifactsByIDs(ctx context.Context, db DBTX, dollar_1 []int64) (int64, error)
30 // Idempotent insert: if a row with the same (repo_id, workflow_file,
31 // trigger_event_id) already exists, returns no rows (pgx.ErrNoRows in
32 // Go). The handler treats that as a successful no-op so worker
33 // retries and admin replays of the same triggering event don't
34 // duplicate runs.
35 //
36 // The ON CONFLICT predicate matches the partial unique index defined
37 // in migration 0051; both must agree for postgres to infer the
38 // target.
39 EnqueueWorkflowRun(ctx context.Context, db DBTX, arg EnqueueWorkflowRunParams) (WorkflowRun, error)
40 GetArtifactByID(ctx context.Context, db DBTX, id int64) (WorkflowArtifact, error)
41 GetFirstStepForJob(ctx context.Context, db DBTX, jobID int64) (WorkflowStep, error)
42 GetOrgSecret(ctx context.Context, db DBTX, arg GetOrgSecretParams) (GetOrgSecretRow, error)
43 GetOrgVariable(ctx context.Context, db DBTX, arg GetOrgVariableParams) (GetOrgVariableRow, error)
44 GetRepoSecret(ctx context.Context, db DBTX, arg GetRepoSecretParams) (GetRepoSecretRow, error)
45 GetRepoVariable(ctx context.Context, db DBTX, arg GetRepoVariableParams) (GetRepoVariableRow, error)
46 GetRunnerByID(ctx context.Context, db DBTX, id int64) (WorkflowRunner, error)
47 GetRunnerByName(ctx context.Context, db DBTX, name string) (WorkflowRunner, error)
48 GetRunnerByTokenHash(ctx context.Context, db DBTX, tokenHash []byte) (GetRunnerByTokenHashRow, error)
49 GetStepLogChunkBefore(ctx context.Context, db DBTX, arg GetStepLogChunkBeforeParams) (WorkflowStepLogChunk, error)
50 GetStepLogChunkByStepSeq(ctx context.Context, db DBTX, arg GetStepLogChunkByStepSeqParams) (WorkflowStepLogChunk, error)
51 GetWorkflowJobByID(ctx context.Context, db DBTX, id int64) (WorkflowJob, error)
52 GetWorkflowJobSecretMask(ctx context.Context, db DBTX, jobID int64) (WorkflowJobSecretMask, error)
53 GetWorkflowRunByID(ctx context.Context, db DBTX, id int64) (WorkflowRun, error)
54 GetWorkflowRunForRepoByIndex(ctx context.Context, db DBTX, arg GetWorkflowRunForRepoByIndexParams) (GetWorkflowRunForRepoByIndexRow, error)
55 GetWorkflowStepByID(ctx context.Context, db DBTX, id int64) (WorkflowStep, error)
56 HeartbeatRunner(ctx context.Context, db DBTX, arg HeartbeatRunnerParams) (WorkflowRunner, error)
57 // SPDX-License-Identifier: AGPL-3.0-or-later
58 InsertArtifact(ctx context.Context, db DBTX, arg InsertArtifactParams) (WorkflowArtifact, error)
59 // SPDX-License-Identifier: AGPL-3.0-or-later
60 InsertRunner(ctx context.Context, db DBTX, arg InsertRunnerParams) (WorkflowRunner, error)
61 InsertRunnerToken(ctx context.Context, db DBTX, arg InsertRunnerTokenParams) (RunnerToken, error)
62 // SPDX-License-Identifier: AGPL-3.0-or-later
63 InsertWorkflowJob(ctx context.Context, db DBTX, arg InsertWorkflowJobParams) (WorkflowJob, error)
64 // SPDX-License-Identifier: AGPL-3.0-or-later
65 InsertWorkflowRun(ctx context.Context, db DBTX, arg InsertWorkflowRunParams) (WorkflowRun, error)
66 // SPDX-License-Identifier: AGPL-3.0-or-later
67 InsertWorkflowStep(ctx context.Context, db DBTX, arg InsertWorkflowStepParams) (WorkflowStep, error)
68 ListAllStepLogChunksForStep(ctx context.Context, db DBTX, stepID int64) ([]WorkflowStepLogChunk, error)
69 ListArtifactsForRun(ctx context.Context, db DBTX, runID int64) ([]ListArtifactsForRunRow, error)
70 // Older queued/running runs with the same group block the new run while they
71 // still have at least one queued/running job that has not already received a
72 // cancel request. cancel-in-progress releases the slot by flipping that job
73 // flag even if the runner is still draining the old container.
74 ListBlockingConcurrencyRunsForUpdate(ctx context.Context, db DBTX, arg ListBlockingConcurrencyRunsForUpdateParams) ([]WorkflowRun, error)
75 ListExpiredWorkflowArtifactsForCleanup(ctx context.Context, db DBTX, arg ListExpiredWorkflowArtifactsForCleanupParams) ([]ListExpiredWorkflowArtifactsForCleanupRow, error)
76 ListJobsForRun(ctx context.Context, db DBTX, runID int64) ([]ListJobsForRunRow, error)
77 ListOrgSecrets(ctx context.Context, db DBTX, orgID pgtype.Int8) ([]ListOrgSecretsRow, error)
78 ListOrgVariables(ctx context.Context, db DBTX, orgID pgtype.Int8) ([]ListOrgVariablesRow, error)
79 ListRepoSecrets(ctx context.Context, db DBTX, repoID pgtype.Int8) ([]ListRepoSecretsRow, error)
80 ListRepoVariables(ctx context.Context, db DBTX, repoID pgtype.Int8) ([]ListRepoVariablesRow, error)
81 ListRunnerStepsForJob(ctx context.Context, db DBTX, jobID int64) ([]ListRunnerStepsForJobRow, error)
82 ListRunners(ctx context.Context, db DBTX) ([]ListRunnersRow, error)
83 ListStepLogChunks(ctx context.Context, db DBTX, arg ListStepLogChunksParams) ([]WorkflowStepLogChunk, error)
84 ListStepsForJob(ctx context.Context, db DBTX, jobID int64) ([]ListStepsForJobRow, error)
85 ListWorkflowRunWorkflowsForRepo(ctx context.Context, db DBTX, repoID int64) ([]ListWorkflowRunWorkflowsForRepoRow, error)
86 ListWorkflowRunsForRepo(ctx context.Context, db DBTX, arg ListWorkflowRunsForRepoParams) ([]ListWorkflowRunsForRepoRow, error)
87 LockRunnerByID(ctx context.Context, db DBTX, id int64) (WorkflowRunner, error)
88 // Companion to EnqueueWorkflowRun for the conflict path: when an
89 // INSERT ... ON CONFLICT DO NOTHING returns no rows, the trigger
90 // handler uses this to find the existing row so it can surface a
91 // stable RunID. Matches the partial-unique index from migration 0051.
92 LookupWorkflowRunByTriggerEvent(ctx context.Context, db DBTX, arg LookupWorkflowRunByTriggerEventParams) (WorkflowRun, error)
93 // SPDX-License-Identifier: AGPL-3.0-or-later
94 MarkRunnerJWTUsed(ctx context.Context, db DBTX, arg MarkRunnerJWTUsedParams) (RunnerJwtUsed, error)
95 MarkWorkflowRunRunning(ctx context.Context, db DBTX, id int64) error
96 // Atomic next-index emitter: take the max + 1 for this repo. Pairs
97 // with the (repo_id, run_index) UNIQUE so concurrent inserts that
98 // race here will catch a unique-violation and the caller retries.
99 // Cast to bigint so sqlc generates int64 (the column type) rather
100 // than int32 (the type the +1 literal would default to).
101 NextRunIndexForRepo(ctx context.Context, db DBTX, repoID int64) (int64, error)
102 RequestWorkflowJobCancel(ctx context.Context, db DBTX, id int64) (WorkflowJob, error)
103 RequestWorkflowRunCancel(ctx context.Context, db DBTX, runID int64) ([]WorkflowJob, error)
104 RevokeAllTokensForRunner(ctx context.Context, db DBTX, runnerID int64) error
105 TouchRunnerHeartbeat(ctx context.Context, db DBTX, arg TouchRunnerHeartbeatParams) error
106 UpdateStepLogChunk(ctx context.Context, db DBTX, arg UpdateStepLogChunkParams) error
107 UpdateWorkflowJobStatus(ctx context.Context, db DBTX, arg UpdateWorkflowJobStatusParams) (WorkflowJob, error)
108 UpdateWorkflowStepLogObject(ctx context.Context, db DBTX, arg UpdateWorkflowStepLogObjectParams) (WorkflowStep, error)
109 UpdateWorkflowStepStatus(ctx context.Context, db DBTX, arg UpdateWorkflowStepStatusParams) (WorkflowStep, error)
110 UpsertOrgSecret(ctx context.Context, db DBTX, arg UpsertOrgSecretParams) (WorkflowSecret, error)
111 UpsertOrgVariable(ctx context.Context, db DBTX, arg UpsertOrgVariableParams) (ActionsVariable, error)
112 // SPDX-License-Identifier: AGPL-3.0-or-later
113 UpsertRepoSecret(ctx context.Context, db DBTX, arg UpsertRepoSecretParams) (WorkflowSecret, error)
114 // SPDX-License-Identifier: AGPL-3.0-or-later
115 UpsertRepoVariable(ctx context.Context, db DBTX, arg UpsertRepoVariableParams) (ActionsVariable, error)
116 // SPDX-License-Identifier: AGPL-3.0-or-later
117 UpsertWorkflowJobSecretMask(ctx context.Context, db DBTX, arg UpsertWorkflowJobSecretMaskParams) error
118 }
119
120 var _ Querier = (*Queries)(nil)
121