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