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