Go · 8745 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 ListExpiredWorkflowArtifactsForCleanup(ctx context.Context, db DBTX, arg ListExpiredWorkflowArtifactsForCleanupParams) ([]ListExpiredWorkflowArtifactsForCleanupRow, error)
71 ListJobsForRun(ctx context.Context, db DBTX, runID int64) ([]ListJobsForRunRow, error)
72 ListOrgSecrets(ctx context.Context, db DBTX, orgID pgtype.Int8) ([]ListOrgSecretsRow, error)
73 ListOrgVariables(ctx context.Context, db DBTX, orgID pgtype.Int8) ([]ListOrgVariablesRow, error)
74 ListRepoSecrets(ctx context.Context, db DBTX, repoID pgtype.Int8) ([]ListRepoSecretsRow, error)
75 ListRepoVariables(ctx context.Context, db DBTX, repoID pgtype.Int8) ([]ListRepoVariablesRow, error)
76 ListRunnerStepsForJob(ctx context.Context, db DBTX, jobID int64) ([]ListRunnerStepsForJobRow, error)
77 ListRunners(ctx context.Context, db DBTX) ([]ListRunnersRow, error)
78 ListStepLogChunks(ctx context.Context, db DBTX, arg ListStepLogChunksParams) ([]WorkflowStepLogChunk, error)
79 ListStepsForJob(ctx context.Context, db DBTX, jobID int64) ([]ListStepsForJobRow, error)
80 ListWorkflowRunWorkflowsForRepo(ctx context.Context, db DBTX, repoID int64) ([]ListWorkflowRunWorkflowsForRepoRow, error)
81 ListWorkflowRunsForRepo(ctx context.Context, db DBTX, arg ListWorkflowRunsForRepoParams) ([]ListWorkflowRunsForRepoRow, error)
82 LockRunnerByID(ctx context.Context, db DBTX, id int64) (WorkflowRunner, error)
83 // Companion to EnqueueWorkflowRun for the conflict path: when an
84 // INSERT ... ON CONFLICT DO NOTHING returns no rows, the trigger
85 // handler uses this to find the existing row so it can surface a
86 // stable RunID. Matches the partial-unique index from migration 0051.
87 LookupWorkflowRunByTriggerEvent(ctx context.Context, db DBTX, arg LookupWorkflowRunByTriggerEventParams) (WorkflowRun, error)
88 // SPDX-License-Identifier: AGPL-3.0-or-later
89 MarkRunnerJWTUsed(ctx context.Context, db DBTX, arg MarkRunnerJWTUsedParams) (RunnerJwtUsed, error)
90 MarkWorkflowRunRunning(ctx context.Context, db DBTX, id int64) error
91 // Atomic next-index emitter: take the max + 1 for this repo. Pairs
92 // with the (repo_id, run_index) UNIQUE so concurrent inserts that
93 // race here will catch a unique-violation and the caller retries.
94 // Cast to bigint so sqlc generates int64 (the column type) rather
95 // than int32 (the type the +1 literal would default to).
96 NextRunIndexForRepo(ctx context.Context, db DBTX, repoID int64) (int64, error)
97 RequestWorkflowJobCancel(ctx context.Context, db DBTX, id int64) (WorkflowJob, error)
98 RequestWorkflowRunCancel(ctx context.Context, db DBTX, runID int64) ([]WorkflowJob, error)
99 RevokeAllTokensForRunner(ctx context.Context, db DBTX, runnerID int64) error
100 TouchRunnerHeartbeat(ctx context.Context, db DBTX, arg TouchRunnerHeartbeatParams) error
101 UpdateStepLogChunk(ctx context.Context, db DBTX, arg UpdateStepLogChunkParams) error
102 UpdateWorkflowJobStatus(ctx context.Context, db DBTX, arg UpdateWorkflowJobStatusParams) (WorkflowJob, error)
103 UpdateWorkflowStepLogObject(ctx context.Context, db DBTX, arg UpdateWorkflowStepLogObjectParams) (WorkflowStep, error)
104 UpdateWorkflowStepStatus(ctx context.Context, db DBTX, arg UpdateWorkflowStepStatusParams) (WorkflowStep, error)
105 UpsertOrgSecret(ctx context.Context, db DBTX, arg UpsertOrgSecretParams) (WorkflowSecret, error)
106 UpsertOrgVariable(ctx context.Context, db DBTX, arg UpsertOrgVariableParams) (ActionsVariable, error)
107 // SPDX-License-Identifier: AGPL-3.0-or-later
108 UpsertRepoSecret(ctx context.Context, db DBTX, arg UpsertRepoSecretParams) (WorkflowSecret, error)
109 // SPDX-License-Identifier: AGPL-3.0-or-later
110 UpsertRepoVariable(ctx context.Context, db DBTX, arg UpsertRepoVariableParams) (ActionsVariable, error)
111 // SPDX-License-Identifier: AGPL-3.0-or-later
112 UpsertWorkflowJobSecretMask(ctx context.Context, db DBTX, arg UpsertWorkflowJobSecretMaskParams) error
113 }
114
115 var _ Querier = (*Queries)(nil)
116