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