// Code generated by sqlc. DO NOT EDIT. // versions: // sqlc v1.31.1 package actionsdb import ( "context" "github.com/jackc/pgx/v5/pgtype" ) type Querier interface { // SPDX-License-Identifier: AGPL-3.0-or-later AppendStepLogChunk(ctx context.Context, db DBTX, arg AppendStepLogChunkParams) (AppendStepLogChunkRow, error) CancelOpenWorkflowStepsForJob(ctx context.Context, db DBTX, jobID int64) ([]WorkflowStep, error) ClaimQueuedWorkflowJob(ctx context.Context, db DBTX, arg ClaimQueuedWorkflowJobParams) (ClaimQueuedWorkflowJobRow, error) CompleteWorkflowRun(ctx context.Context, db DBTX, arg CompleteWorkflowRunParams) (WorkflowRun, error) CountRunningJobsForRunner(ctx context.Context, db DBTX, runnerID int64) (int32, error) CountWorkflowCachesForRepo(ctx context.Context, db DBTX, arg CountWorkflowCachesForRepoParams) (int64, error) CountWorkflowRunsForRepo(ctx context.Context, db DBTX, arg CountWorkflowRunsForRepoParams) (int64, error) DeleteOldRunnerJWTUsesForCleanup(ctx context.Context, db DBTX, expiresAt pgtype.Timestamptz) (int64, error) DeleteOldWorkflowRunsForCleanup(ctx context.Context, db DBTX, completedAt pgtype.Timestamptz) (int64, error) DeleteOrgSecret(ctx context.Context, db DBTX, arg DeleteOrgSecretParams) error DeleteOrgVariable(ctx context.Context, db DBTX, arg DeleteOrgVariableParams) error DeleteRepoSecret(ctx context.Context, db DBTX, arg DeleteRepoSecretParams) error DeleteRepoVariable(ctx context.Context, db DBTX, arg DeleteRepoVariableParams) error DeleteStaleStepLogChunksForCleanup(ctx context.Context, db DBTX, completedAt pgtype.Timestamptz) (int64, error) DeleteStepLogChunks(ctx context.Context, db DBTX, stepID int64) error DeleteWorkflowArtifactByID(ctx context.Context, db DBTX, id int64) (int64, error) DeleteWorkflowArtifactsByIDs(ctx context.Context, db DBTX, dollar_1 []int64) (int64, error) DeleteWorkflowCacheByID(ctx context.Context, db DBTX, arg DeleteWorkflowCacheByIDParams) (int64, error) // Returns the deleted rows' object_keys so the handler can purge the // backing tarballs from object storage. DeleteWorkflowCachesByKey(ctx context.Context, db DBTX, arg DeleteWorkflowCachesByKeyParams) ([]string, error) // Cascades to workflow_jobs → workflow_steps → workflow_step_log_chunks // and workflow_artifacts via the on-delete-cascade FK chain. The // S3-side artifact blobs are NOT removed here; the handler queries // the artifact object_keys first and deletes them best-effort after // the row is gone. DeleteWorkflowRunByID(ctx context.Context, db DBTX, id int64) (int64, error) // Idempotent: re-disabling an already-disabled workflow is a no-op // and does not bump disabled_at. DisableWorkflow(ctx context.Context, db DBTX, arg DisableWorkflowParams) error // Returns affected-rows so the handler can distinguish 200 (re-enabled) // from 404-ish no-op. EnableWorkflow(ctx context.Context, db DBTX, arg EnableWorkflowParams) (int64, error) // Idempotent insert: if a row with the same (repo_id, workflow_file, // trigger_event_id) already exists, returns no rows (pgx.ErrNoRows in // Go). The handler treats that as a successful no-op so worker // retries and admin replays of the same triggering event don't // duplicate runs. // // The ON CONFLICT predicate matches the partial unique index defined // in migration 0051; both must agree for postgres to infer the // target. EnqueueWorkflowRun(ctx context.Context, db DBTX, arg EnqueueWorkflowRunParams) (WorkflowRun, error) GetArtifactByID(ctx context.Context, db DBTX, id int64) (WorkflowArtifact, error) GetFirstStepForJob(ctx context.Context, db DBTX, jobID int64) (WorkflowStep, error) GetOrgSecret(ctx context.Context, db DBTX, arg GetOrgSecretParams) (GetOrgSecretRow, error) GetOrgVariable(ctx context.Context, db DBTX, arg GetOrgVariableParams) (GetOrgVariableRow, error) GetRepoSecret(ctx context.Context, db DBTX, arg GetRepoSecretParams) (GetRepoSecretRow, error) GetRepoVariable(ctx context.Context, db DBTX, arg GetRepoVariableParams) (GetRepoVariableRow, error) GetRunnerByID(ctx context.Context, db DBTX, id int64) (WorkflowRunner, error) GetRunnerByName(ctx context.Context, db DBTX, name string) (WorkflowRunner, error) GetRunnerByTokenHash(ctx context.Context, db DBTX, tokenHash []byte) (GetRunnerByTokenHashRow, error) GetStepLogChunkBefore(ctx context.Context, db DBTX, arg GetStepLogChunkBeforeParams) (WorkflowStepLogChunk, error) GetStepLogChunkByStepSeq(ctx context.Context, db DBTX, arg GetStepLogChunkByStepSeqParams) (WorkflowStepLogChunk, error) GetWorkflowCacheByID(ctx context.Context, db DBTX, id int64) (WorkflowCache, error) GetWorkflowJobByID(ctx context.Context, db DBTX, id int64) (WorkflowJob, error) GetWorkflowJobSecretMask(ctx context.Context, db DBTX, jobID int64) (WorkflowJobSecretMask, error) GetWorkflowRunByID(ctx context.Context, db DBTX, id int64) (WorkflowRun, error) GetWorkflowRunForRepoByIndex(ctx context.Context, db DBTX, arg GetWorkflowRunForRepoByIndexParams) (GetWorkflowRunForRepoByIndexRow, error) GetWorkflowStepByID(ctx context.Context, db DBTX, id int64) (WorkflowStep, error) HeartbeatRunner(ctx context.Context, db DBTX, arg HeartbeatRunnerParams) (WorkflowRunner, error) // SPDX-License-Identifier: AGPL-3.0-or-later InsertArtifact(ctx context.Context, db DBTX, arg InsertArtifactParams) (WorkflowArtifact, error) // SPDX-License-Identifier: AGPL-3.0-or-later InsertRunner(ctx context.Context, db DBTX, arg InsertRunnerParams) (WorkflowRunner, error) InsertRunnerToken(ctx context.Context, db DBTX, arg InsertRunnerTokenParams) (RunnerToken, error) // SPDX-License-Identifier: AGPL-3.0-or-later // Called by the future runner-side upload handler when an // actions/cache step completes its tarball upload. Idempotent on // (repo_id, cache_key, cache_version, git_ref): a re-upload with the // same coordinates updates size + last_accessed_at + object_key. InsertWorkflowCache(ctx context.Context, db DBTX, arg InsertWorkflowCacheParams) (WorkflowCache, error) // SPDX-License-Identifier: AGPL-3.0-or-later InsertWorkflowJob(ctx context.Context, db DBTX, arg InsertWorkflowJobParams) (WorkflowJob, error) // SPDX-License-Identifier: AGPL-3.0-or-later InsertWorkflowRun(ctx context.Context, db DBTX, arg InsertWorkflowRunParams) (WorkflowRun, error) // SPDX-License-Identifier: AGPL-3.0-or-later InsertWorkflowStep(ctx context.Context, db DBTX, arg InsertWorkflowStepParams) (WorkflowStep, error) // SPDX-License-Identifier: AGPL-3.0-or-later // Hot path for trigger.Enqueue: skip enqueueing when the row exists. IsWorkflowDisabled(ctx context.Context, db DBTX, arg IsWorkflowDisabledParams) (bool, error) ListActiveWorkflowRunsForAdmin(ctx context.Context, db DBTX, arg ListActiveWorkflowRunsForAdminParams) ([]WorkflowRun, error) ListAllStepLogChunksForStep(ctx context.Context, db DBTX, stepID int64) ([]WorkflowStepLogChunk, error) // Used by the run-delete REST handler to drive a best-effort S3 // cleanup after the workflow_runs row (and its cascaded // workflow_artifacts rows) have been removed. ListArtifactObjectKeysForRun(ctx context.Context, db DBTX, runID int64) ([]string, error) ListArtifactsForRun(ctx context.Context, db DBTX, runID int64) ([]ListArtifactsForRunRow, error) // Older queued/running runs with the same group block the new run while they // still have at least one queued/running job that has not already received a // cancel request. cancel-in-progress releases the slot by flipping that job // flag even if the runner is still draining the old container. ListBlockingConcurrencyRunsForUpdate(ctx context.Context, db DBTX, arg ListBlockingConcurrencyRunsForUpdateParams) ([]WorkflowRun, error) // Used by the workflows-list endpoint to mark `state: "disabled"` // entries without round-tripping through Is for every file. ListDisabledWorkflowsForRepo(ctx context.Context, db DBTX, repoID int64) ([]string, error) ListExpiredWorkflowArtifactsForCleanup(ctx context.Context, db DBTX, arg ListExpiredWorkflowArtifactsForCleanupParams) ([]ListExpiredWorkflowArtifactsForCleanupRow, error) ListJobsForRun(ctx context.Context, db DBTX, runID int64) ([]ListJobsForRunRow, error) ListOrgSecrets(ctx context.Context, db DBTX, orgID pgtype.Int8) ([]ListOrgSecretsRow, error) ListOrgVariables(ctx context.Context, db DBTX, orgID pgtype.Int8) ([]ListOrgVariablesRow, error) ListQueuedWorkflowJobRunsOn(ctx context.Context, db DBTX) ([]ListQueuedWorkflowJobRunsOnRow, error) ListRepoSecrets(ctx context.Context, db DBTX, repoID pgtype.Int8) ([]ListRepoSecretsRow, error) ListRepoVariables(ctx context.Context, db DBTX, repoID pgtype.Int8) ([]ListRepoVariablesRow, error) ListRunnerStepsForJob(ctx context.Context, db DBTX, jobID int64) ([]ListRunnerStepsForJobRow, error) ListRunners(ctx context.Context, db DBTX) ([]ListRunnersRow, error) ListStepLogChunks(ctx context.Context, db DBTX, arg ListStepLogChunksParams) ([]WorkflowStepLogChunk, error) ListStepsForJob(ctx context.Context, db DBTX, jobID int64) ([]ListStepsForJobRow, error) // Paginated list filtered optionally by ref + key. NULL params skip // the filter. Sorted by last_accessed_at DESC so an operator sees the // live caches first. ListWorkflowCachesForRepo(ctx context.Context, db DBTX, arg ListWorkflowCachesForRepoParams) ([]WorkflowCache, error) ListWorkflowRunWorkflowsForRepo(ctx context.Context, db DBTX, repoID int64) ([]ListWorkflowRunWorkflowsForRepoRow, error) ListWorkflowRunsForRepo(ctx context.Context, db DBTX, arg ListWorkflowRunsForRepoParams) ([]ListWorkflowRunsForRepoRow, error) LockRunnerByID(ctx context.Context, db DBTX, id int64) (WorkflowRunner, error) // Companion to EnqueueWorkflowRun for the conflict path: when an // INSERT ... ON CONFLICT DO NOTHING returns no rows, the trigger // handler uses this to find the existing row so it can surface a // stable RunID. Matches the partial-unique index from migration 0051. LookupWorkflowRunByTriggerEvent(ctx context.Context, db DBTX, arg LookupWorkflowRunByTriggerEventParams) (WorkflowRun, error) // SPDX-License-Identifier: AGPL-3.0-or-later MarkRunnerJWTUsed(ctx context.Context, db DBTX, arg MarkRunnerJWTUsedParams) (RunnerJwtUsed, error) MarkWorkflowRunRunning(ctx context.Context, db DBTX, id int64) error // Atomic next-index emitter: take the max + 1 for this repo. Pairs // with the (repo_id, run_index) UNIQUE so concurrent inserts that // race here will catch a unique-violation and the caller retries. // Cast to bigint so sqlc generates int64 (the column type) rather // than int32 (the type the +1 literal would default to). NextRunIndexForRepo(ctx context.Context, db DBTX, repoID int64) (int64, error) RequestWorkflowJobCancel(ctx context.Context, db DBTX, id int64) (WorkflowJob, error) RequestWorkflowRunCancel(ctx context.Context, db DBTX, runID int64) ([]WorkflowJob, error) RevokeAllTokensForRunner(ctx context.Context, db DBTX, runnerID int64) error StartWorkflowRun(ctx context.Context, db DBTX, id int64) (WorkflowRun, error) TouchRunnerHeartbeat(ctx context.Context, db DBTX, arg TouchRunnerHeartbeatParams) error // Bumps last_accessed_at on cache hit. Called by the future // restore-side handler. TouchWorkflowCache(ctx context.Context, db DBTX, id int64) error UpdateStepLogChunk(ctx context.Context, db DBTX, arg UpdateStepLogChunkParams) error UpdateWorkflowJobStatus(ctx context.Context, db DBTX, arg UpdateWorkflowJobStatusParams) (WorkflowJob, error) UpdateWorkflowStepLogObject(ctx context.Context, db DBTX, arg UpdateWorkflowStepLogObjectParams) (WorkflowStep, error) UpdateWorkflowStepStatus(ctx context.Context, db DBTX, arg UpdateWorkflowStepStatusParams) (WorkflowStep, error) UpsertOrgSecret(ctx context.Context, db DBTX, arg UpsertOrgSecretParams) (WorkflowSecret, error) UpsertOrgVariable(ctx context.Context, db DBTX, arg UpsertOrgVariableParams) (ActionsVariable, error) // SPDX-License-Identifier: AGPL-3.0-or-later UpsertRepoSecret(ctx context.Context, db DBTX, arg UpsertRepoSecretParams) (WorkflowSecret, error) // SPDX-License-Identifier: AGPL-3.0-or-later UpsertRepoVariable(ctx context.Context, db DBTX, arg UpsertRepoVariableParams) (ActionsVariable, error) // SPDX-License-Identifier: AGPL-3.0-or-later UpsertWorkflowJobSecretMask(ctx context.Context, db DBTX, arg UpsertWorkflowJobSecretMaskParams) error } var _ Querier = (*Queries)(nil)