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