Documentation
¶
Overview ¶
Package store provides PostgreSQL-backed data persistence using pgx and sqlc.
Index ¶
- Constants
- Variables
- func CurrentSchemaVersion(ctx context.Context, pool *pgxpool.Pool) (int32, error)
- func FromPGUUID[S ~string](u pgtype.UUID) S
- func RunMigrations(ctx context.Context, pool *pgxpool.Pool) error
- func ToPGUUID[S ~string](id S) pgtype.UUID
- type ApiToken
- type ArtifactBundle
- type BootstrapToken
- type CancelActiveJobsByRunAttemptParams
- type ClearRepoSHAChainFromJobParams
- type CompleteBootstrapEnrollmentParams
- type ConfigBundleMap
- type ConfigEnv
- type ConfigIn
- type CountJobsByRunAndStatusParams
- type CountJobsByRunAttemptGroupByStatusParams
- type CountJobsByRunAttemptGroupByStatusRow
- type CountRunsByWaveStatusRow
- type CreateArtifactBundleParams
- type CreateDiffParams
- type CreateEventParams
- type CreateJobParams
- type CreateLogParams
- type CreateMigParams
- type CreateMigRepoParams
- type CreateNamedSpecParams
- type CreateNodeDaemonLogParams
- type CreateNodeParams
- type CreateRunParams
- type CreateSpecBundleParams
- type CreateSpecParams
- type CreateWaveParams
- type CreateWaveWithRunsParams
- type DBTX
- type DeleteConfigInParams
- type DeleteGlobalEnvParams
- type Diff
- type Event
- type GetAPITokenByIDRow
- type GetAdjacentJobIndicesRow
- type GetBootstrapTokenRow
- type GetGlobalEnvParams
- type GetLatestRunByMigAndRepoStatusParams
- type GetLatestRunByMigAndRepoStatusRow
- type GetMigRepoByURLParams
- type GetNamedSpecByNameSourceSHAParams
- type GetRunSnapshotMetadataRow
- type HasRunningJobForRunNodeParams
- type IncrementRunAttemptParams
- type InsertAPITokenParams
- type InsertBootstrapTokenParams
- type Job
- type JobMetric
- type ListAPITokensRow
- type ListArtifactBundlesByRunAndJobParams
- type ListCreatedJobsByRunAttemptParams
- type ListDistinctReposRow
- type ListEventsByRunSinceParams
- type ListJobsByRunAttemptParams
- type ListJobsForTUIParams
- type ListJobsForTUIRow
- type ListLatestNamedSpecsParams
- type ListLatestNamedSpecsRow
- type ListLogsByRunAndJobParams
- type ListLogsByRunAndJobSinceParams
- type ListLogsByRunSinceParams
- type ListMigsParams
- type ListNodeDaemonLogsParams
- type ListRunSBOMRowsByJobTypeParams
- type ListRunSBOMRowsByJobTypeRow
- type ListRunsForRepoParams
- type ListRunsForRepoRow
- type ListRunsParams
- type ListRunsTimingsParams
- type ListRunsWithMetadataParams
- type ListRunsWithMetadataRow
- type ListRunsWithURLByWaveRow
- type ListSpecBundlesParams
- type ListSpecsParams
- type ListStaleRunningJobsRow
- type ListWavesByMigParams
- type ListWavesParams
- type Log
- type Mig
- type MigRepo
- type Node
- type NodeDaemonLog
- type NodeDiagnostic
- type NodeMetric
- type PgStore
- func (s *PgStore) CancelRun(ctx context.Context, runID types.RunID) error
- func (s *PgStore) CancelWave(ctx context.Context, waveID types.WaveID) error
- func (s *PgStore) ClaimJob(ctx context.Context, nodeID types.NodeID) (Job, error)
- func (s *PgStore) Close()
- func (s *PgStore) CompleteBootstrapEnrollment(ctx context.Context, arg CompleteBootstrapEnrollmentParams) error
- func (s *PgStore) CreateDiff(ctx context.Context, arg CreateDiffParams) (Diff, error)
- func (s *PgStore) CreateJob(ctx context.Context, arg CreateJobParams) (Job, error)
- func (s *PgStore) CreateNamedSpec(ctx context.Context, arg CreateNamedSpecParams) (Spec, error)
- func (s *PgStore) CreateRun(ctx context.Context, arg CreateRunParams) (Run, error)
- func (s *PgStore) CreateSpec(ctx context.Context, arg CreateSpecParams) (Spec, error)
- func (s *PgStore) CreateWaveWithRuns(ctx context.Context, arg CreateWaveWithRunsParams) (Wave, []Run, error)
- func (s *PgStore) Pool() *pgxpool.Pool
- func (s *PgStore) RestartRun(ctx context.Context, arg RestartRunParams) (Run, error)
- func (s *PgStore) UnclaimJob(ctx context.Context, arg UnclaimJobParams) error
- func (s *PgStore) UpdateJobCompletionWithMeta(ctx context.Context, arg UpdateJobCompletionWithMetaParams) error
- func (s *PgStore) UpdateJobMeta(ctx context.Context, arg UpdateJobMetaParams) error
- func (s *PgStore) UpdateWaveCompletion(ctx context.Context, arg UpdateWaveCompletionParams) error
- func (s *PgStore) UpsertNodeDiagnostic(ctx context.Context, arg UpsertNodeDiagnosticParams) (NodeDiagnostic, error)
- type Querier
- type Queries
- func (q *Queries) ArchiveMig(ctx context.Context, id types.MigID) error
- func (q *Queries) CancelActiveJobsByRun(ctx context.Context, runID types.RunID) (int64, error)
- func (q *Queries) CancelActiveJobsByRunAttempt(ctx context.Context, arg CancelActiveJobsByRunAttemptParams) (int64, error)
- func (q *Queries) CancelActiveRunsByWave(ctx context.Context, waveID types.WaveID) (int64, error)
- func (q *Queries) CheckAPITokenRevoked(ctx context.Context, tokenID string) (pgtype.Timestamptz, error)
- func (q *Queries) CheckBootstrapTokenRevoked(ctx context.Context, tokenID string) (pgtype.Timestamptz, error)
- func (q *Queries) ClaimJob(ctx context.Context, nodeID types.NodeID) (Job, error)
- func (q *Queries) ClearRepoSHAChainFromJob(ctx context.Context, arg ClearRepoSHAChainFromJobParams) (int64, error)
- func (q *Queries) CountJobsByRun(ctx context.Context, runID types.RunID) (int64, error)
- func (q *Queries) CountJobsByRunAndStatus(ctx context.Context, arg CountJobsByRunAndStatusParams) (int64, error)
- func (q *Queries) CountJobsByRunAttemptGroupByStatus(ctx context.Context, arg CountJobsByRunAttemptGroupByStatusParams) ([]CountJobsByRunAttemptGroupByStatusRow, error)
- func (q *Queries) CountJobsForTUI(ctx context.Context, runID *string) (int64, error)
- func (q *Queries) CountRunsByWaveStatus(ctx context.Context, waveID types.WaveID) ([]CountRunsByWaveStatusRow, error)
- func (q *Queries) CountStaleNodesWithRunningJobs(ctx context.Context, lastHeartbeat pgtype.Timestamptz) (int64, error)
- func (q *Queries) CreateArtifactBundle(ctx context.Context, arg CreateArtifactBundleParams) (ArtifactBundle, error)
- func (q *Queries) CreateDiff(ctx context.Context, arg CreateDiffParams) (Diff, error)
- func (q *Queries) CreateEvent(ctx context.Context, arg CreateEventParams) (Event, error)
- func (q *Queries) CreateJob(ctx context.Context, arg CreateJobParams) (Job, error)
- func (q *Queries) CreateLog(ctx context.Context, arg CreateLogParams) (Log, error)
- func (q *Queries) CreateMig(ctx context.Context, arg CreateMigParams) (Mig, error)
- func (q *Queries) CreateMigRepo(ctx context.Context, arg CreateMigRepoParams) (MigRepo, error)
- func (q *Queries) CreateNamedSpec(ctx context.Context, arg CreateNamedSpecParams) (Spec, error)
- func (q *Queries) CreateNode(ctx context.Context, arg CreateNodeParams) (Node, error)
- func (q *Queries) CreateNodeDaemonLog(ctx context.Context, arg CreateNodeDaemonLogParams) (NodeDaemonLog, error)
- func (q *Queries) CreateRun(ctx context.Context, arg CreateRunParams) (Run, error)
- func (q *Queries) CreateSpec(ctx context.Context, arg CreateSpecParams) (Spec, error)
- func (q *Queries) CreateSpecBundle(ctx context.Context, arg CreateSpecBundleParams) (SpecBundle, error)
- func (q *Queries) CreateWave(ctx context.Context, arg CreateWaveParams) (Wave, error)
- func (q *Queries) DeleteArtifactBundle(ctx context.Context, id pgtype.UUID) error
- func (q *Queries) DeleteArtifactBundlesOlderThan(ctx context.Context, createdAt pgtype.Timestamptz) error
- func (q *Queries) DeleteConfigBundleMap(ctx context.Context, hash string) error
- func (q *Queries) DeleteConfigIn(ctx context.Context, arg DeleteConfigInParams) error
- func (q *Queries) DeleteConfigInBySection(ctx context.Context, section string) error
- func (q *Queries) DeleteDiff(ctx context.Context, id pgtype.UUID) error
- func (q *Queries) DeleteDiffsOlderThan(ctx context.Context, createdAt pgtype.Timestamptz) error
- func (q *Queries) DeleteExpiredArtifactBundles(ctx context.Context, createdAt pgtype.Timestamptz) (int64, error)
- func (q *Queries) DeleteExpiredDiffs(ctx context.Context, createdAt pgtype.Timestamptz) (int64, error)
- func (q *Queries) DeleteExpiredEvents(ctx context.Context, time pgtype.Timestamptz) (int64, error)
- func (q *Queries) DeleteExpiredLogs(ctx context.Context, createdAt pgtype.Timestamptz) (int64, error)
- func (q *Queries) DeleteGlobalEnv(ctx context.Context, arg DeleteGlobalEnvParams) error
- func (q *Queries) DeleteJob(ctx context.Context, id types.JobID) error
- func (q *Queries) DeleteLog(ctx context.Context, id int64) error
- func (q *Queries) DeleteLogsOlderThan(ctx context.Context, createdAt pgtype.Timestamptz) error
- func (q *Queries) DeleteMig(ctx context.Context, id types.MigID) error
- func (q *Queries) DeleteMigRepo(ctx context.Context, id types.MigRepoID) error
- func (q *Queries) DeleteNode(ctx context.Context, id types.NodeID) error
- func (q *Queries) DeleteRun(ctx context.Context, id types.RunID) error
- func (q *Queries) DeleteSBOMRowsByJob(ctx context.Context, jobID types.JobID) error
- func (q *Queries) DeleteSpecBundle(ctx context.Context, id string) error
- func (q *Queries) DeleteWave(ctx context.Context, id types.WaveID) error
- func (q *Queries) GetAPITokenByID(ctx context.Context, tokenID string) (GetAPITokenByIDRow, error)
- func (q *Queries) GetAdjacentJobIndices(ctx context.Context, id types.JobID) (GetAdjacentJobIndicesRow, error)
- func (q *Queries) GetArtifactBundle(ctx context.Context, id pgtype.UUID) (ArtifactBundle, error)
- func (q *Queries) GetBootstrapToken(ctx context.Context, tokenID string) (GetBootstrapTokenRow, error)
- func (q *Queries) GetEvent(ctx context.Context, id int64) (Event, error)
- func (q *Queries) GetGlobalEnv(ctx context.Context, arg GetGlobalEnvParams) (ConfigEnv, error)
- func (q *Queries) GetJob(ctx context.Context, id types.JobID) (Job, error)
- func (q *Queries) GetLatestDiffByJob(ctx context.Context, jobID *types.JobID) (Diff, error)
- func (q *Queries) GetLatestRunByMigAndRepoStatus(ctx context.Context, arg GetLatestRunByMigAndRepoStatusParams) (GetLatestRunByMigAndRepoStatusRow, error)
- func (q *Queries) GetLog(ctx context.Context, id int64) (Log, error)
- func (q *Queries) GetMig(ctx context.Context, id types.MigID) (Mig, error)
- func (q *Queries) GetMigByName(ctx context.Context, name string) (Mig, error)
- func (q *Queries) GetMigRepo(ctx context.Context, id types.MigRepoID) (MigRepo, error)
- func (q *Queries) GetMigRepoByURL(ctx context.Context, arg GetMigRepoByURLParams) (MigRepo, error)
- func (q *Queries) GetNamedSpecByNameSourceSHA(ctx context.Context, arg GetNamedSpecByNameSourceSHAParams) (Spec, error)
- func (q *Queries) GetNode(ctx context.Context, id types.NodeID) (Node, error)
- func (q *Queries) GetRepo(ctx context.Context, id types.RepoID) (Repo, error)
- func (q *Queries) GetRun(ctx context.Context, id types.RunID) (Run, error)
- func (q *Queries) GetRunSnapshotMetadata(ctx context.Context, id types.RunID) (GetRunSnapshotMetadataRow, error)
- func (q *Queries) GetRunTiming(ctx context.Context, id types.RunID) (RunsTiming, error)
- func (q *Queries) GetSpec(ctx context.Context, id types.SpecID) (Spec, error)
- func (q *Queries) GetSpecBundle(ctx context.Context, id string) (SpecBundle, error)
- func (q *Queries) GetSpecBundleByCID(ctx context.Context, cid string) (SpecBundle, error)
- func (q *Queries) GetWave(ctx context.Context, id types.WaveID) (Wave, error)
- func (q *Queries) HasMigRepoHistory(ctx context.Context, repoID types.RepoID) (bool, error)
- func (q *Queries) HasRunningJobForRunNode(ctx context.Context, arg HasRunningJobForRunNodeParams) (bool, error)
- func (q *Queries) IncrementRunAttempt(ctx context.Context, arg IncrementRunAttemptParams) error
- func (q *Queries) InsertAPIToken(ctx context.Context, arg InsertAPITokenParams) error
- func (q *Queries) InsertBootstrapToken(ctx context.Context, arg InsertBootstrapTokenParams) error
- func (q *Queries) ListAPITokens(ctx context.Context) ([]ListAPITokensRow, error)
- func (q *Queries) ListArtifactBundlePartitions(ctx context.Context) ([]string, error)
- func (q *Queries) ListArtifactBundlesByCID(ctx context.Context, cid *string) ([]ArtifactBundle, error)
- func (q *Queries) ListArtifactBundlesByRun(ctx context.Context, runID types.RunID) ([]ArtifactBundle, error)
- func (q *Queries) ListArtifactBundlesByRunAndJob(ctx context.Context, arg ListArtifactBundlesByRunAndJobParams) ([]ArtifactBundle, error)
- func (q *Queries) ListConfigBundleMap(ctx context.Context) ([]ConfigBundleMap, error)
- func (q *Queries) ListConfigIn(ctx context.Context) ([]ConfigIn, error)
- func (q *Queries) ListConfigInBySection(ctx context.Context, section string) ([]ConfigIn, error)
- func (q *Queries) ListCreatedJobsByRunAttempt(ctx context.Context, arg ListCreatedJobsByRunAttemptParams) ([]Job, error)
- func (q *Queries) ListDiffsByRun(ctx context.Context, runID types.RunID) ([]Diff, error)
- func (q *Queries) ListDistinctRepos(ctx context.Context, filter string) ([]ListDistinctReposRow, error)
- func (q *Queries) ListEventPartitions(ctx context.Context) ([]string, error)
- func (q *Queries) ListEventsByRun(ctx context.Context, runID types.RunID) ([]Event, error)
- func (q *Queries) ListEventsByRunSince(ctx context.Context, arg ListEventsByRunSinceParams) ([]Event, error)
- func (q *Queries) ListFailedRepoIDsByMig(ctx context.Context, migID types.MigID) ([]types.RepoID, error)
- func (q *Queries) ListGlobalEnv(ctx context.Context) ([]ConfigEnv, error)
- func (q *Queries) ListJobsByRun(ctx context.Context, runID types.RunID) ([]Job, error)
- func (q *Queries) ListJobsByRunAttempt(ctx context.Context, arg ListJobsByRunAttemptParams) ([]Job, error)
- func (q *Queries) ListJobsForTUI(ctx context.Context, arg ListJobsForTUIParams) ([]ListJobsForTUIRow, error)
- func (q *Queries) ListLatestNamedSpecs(ctx context.Context, arg ListLatestNamedSpecsParams) ([]ListLatestNamedSpecsRow, error)
- func (q *Queries) ListLogPartitions(ctx context.Context) ([]string, error)
- func (q *Queries) ListLogsByRun(ctx context.Context, runID types.RunID) ([]Log, error)
- func (q *Queries) ListLogsByRunAndJob(ctx context.Context, arg ListLogsByRunAndJobParams) ([]Log, error)
- func (q *Queries) ListLogsByRunAndJobSince(ctx context.Context, arg ListLogsByRunAndJobSinceParams) ([]Log, error)
- func (q *Queries) ListLogsByRunSince(ctx context.Context, arg ListLogsByRunSinceParams) ([]Log, error)
- func (q *Queries) ListMigReposByMig(ctx context.Context, migID types.MigID) ([]MigRepo, error)
- func (q *Queries) ListMigs(ctx context.Context, arg ListMigsParams) ([]Mig, error)
- func (q *Queries) ListNodeDaemonLogs(ctx context.Context, arg ListNodeDaemonLogsParams) ([]NodeDaemonLog, error)
- func (q *Queries) ListNodeDiagnostics(ctx context.Context, nodeID types.NodeID) ([]NodeDiagnostic, error)
- func (q *Queries) ListNodeMetricsPartitions(ctx context.Context) ([]string, error)
- func (q *Queries) ListNodes(ctx context.Context) ([]Node, error)
- func (q *Queries) ListQueuedRunsByWave(ctx context.Context, waveID types.WaveID) ([]Run, error)
- func (q *Queries) ListRunSBOMRowsByJobType(ctx context.Context, arg ListRunSBOMRowsByJobTypeParams) ([]ListRunSBOMRowsByJobTypeRow, error)
- func (q *Queries) ListRuns(ctx context.Context, arg ListRunsParams) ([]Run, error)
- func (q *Queries) ListRunsByWave(ctx context.Context, waveID types.WaveID) ([]Run, error)
- func (q *Queries) ListRunsForRepo(ctx context.Context, arg ListRunsForRepoParams) ([]ListRunsForRepoRow, error)
- func (q *Queries) ListRunsTimings(ctx context.Context, arg ListRunsTimingsParams) ([]RunsTiming, error)
- func (q *Queries) ListRunsWithMetadata(ctx context.Context, arg ListRunsWithMetadataParams) ([]ListRunsWithMetadataRow, error)
- func (q *Queries) ListRunsWithURLByWave(ctx context.Context, waveID types.WaveID) ([]ListRunsWithURLByWaveRow, error)
- func (q *Queries) ListSpecBundles(ctx context.Context, arg ListSpecBundlesParams) ([]SpecBundle, error)
- func (q *Queries) ListSpecBundlesUnreferencedBefore(ctx context.Context, lastRefAt pgtype.Timestamptz) ([]SpecBundle, error)
- func (q *Queries) ListSpecs(ctx context.Context, arg ListSpecsParams) ([]Spec, error)
- func (q *Queries) ListStaleRunningJobs(ctx context.Context, lastHeartbeat pgtype.Timestamptz) ([]ListStaleRunningJobsRow, error)
- func (q *Queries) ListWaves(ctx context.Context, arg ListWavesParams) ([]Wave, error)
- func (q *Queries) ListWavesByMig(ctx context.Context, arg ListWavesByMigParams) ([]Wave, error)
- func (q *Queries) ListWavesWithQueuedRuns(ctx context.Context) ([]types.WaveID, error)
- func (q *Queries) MarkBootstrapTokenCertIssued(ctx context.Context, tokenID string) error
- func (q *Queries) PromoteJobByIDIfUnblocked(ctx context.Context, id types.JobID) (Job, error)
- func (q *Queries) ResolveLatestNamedSpecByDomainRepoName(ctx context.Context, arg ResolveLatestNamedSpecByDomainRepoNameParams) ([]ResolveLatestNamedSpecByDomainRepoNameRow, error)
- func (q *Queries) ResolveLatestNamedSpecByName(ctx context.Context, arg ResolveLatestNamedSpecByNameParams) ([]ResolveLatestNamedSpecByNameRow, error)
- func (q *Queries) ResolveLatestNamedSpecByRepoName(ctx context.Context, arg ResolveLatestNamedSpecByRepoNameParams) ([]ResolveLatestNamedSpecByRepoNameRow, error)
- func (q *Queries) ResolveNamedSpecVersionByDomainRepoName(ctx context.Context, arg ResolveNamedSpecVersionByDomainRepoNameParams) ([]Spec, error)
- func (q *Queries) ResolveNamedSpecVersionByName(ctx context.Context, arg ResolveNamedSpecVersionByNameParams) ([]Spec, error)
- func (q *Queries) ResolveNamedSpecVersionByRepoName(ctx context.Context, arg ResolveNamedSpecVersionByRepoNameParams) ([]Spec, error)
- func (q *Queries) RevokeAPIToken(ctx context.Context, tokenID string) error
- func (q *Queries) ScheduleNextJob(ctx context.Context, arg ScheduleNextJobParams) (Job, error)
- func (q *Queries) TrimNodeDaemonLogs(ctx context.Context, arg TrimNodeDaemonLogsParams) error
- func (q *Queries) UnarchiveMig(ctx context.Context, id types.MigID) error
- func (q *Queries) UnclaimJob(ctx context.Context, arg UnclaimJobParams) error
- func (q *Queries) UpdateAPITokenLastUsed(ctx context.Context, tokenID string) error
- func (q *Queries) UpdateBootstrapTokenLastUsed(ctx context.Context, tokenID string) error
- func (q *Queries) UpdateJobCompletion(ctx context.Context, arg UpdateJobCompletionParams) error
- func (q *Queries) UpdateJobCompletionWithMeta(ctx context.Context, arg UpdateJobCompletionWithMetaParams) error
- func (q *Queries) UpdateJobImageName(ctx context.Context, arg UpdateJobImageNameParams) error
- func (q *Queries) UpdateJobMeta(ctx context.Context, arg UpdateJobMetaParams) error
- func (q *Queries) UpdateJobNextID(ctx context.Context, arg UpdateJobNextIDParams) error
- func (q *Queries) UpdateJobRepoSHAIn(ctx context.Context, arg UpdateJobRepoSHAInParams) error
- func (q *Queries) UpdateJobStatus(ctx context.Context, arg UpdateJobStatusParams) error
- func (q *Queries) UpdateMigRepoBaseRef(ctx context.Context, arg UpdateMigRepoBaseRefParams) error
- func (q *Queries) UpdateMigSpec(ctx context.Context, arg UpdateMigSpecParams) error
- func (q *Queries) UpdateNamedSpecArchiveState(ctx context.Context, arg UpdateNamedSpecArchiveStateParams) (Spec, error)
- func (q *Queries) UpdateNodeCertMetadata(ctx context.Context, arg UpdateNodeCertMetadataParams) error
- func (q *Queries) UpdateNodeDrained(ctx context.Context, arg UpdateNodeDrainedParams) error
- func (q *Queries) UpdateNodeHeartbeat(ctx context.Context, arg UpdateNodeHeartbeatParams) error
- func (q *Queries) UpdateRunBaseRef(ctx context.Context, arg UpdateRunBaseRefParams) error
- func (q *Queries) UpdateRunError(ctx context.Context, arg UpdateRunErrorParams) error
- func (q *Queries) UpdateRunResume(ctx context.Context, id types.RunID) error
- func (q *Queries) UpdateRunStatus(ctx context.Context, arg UpdateRunStatusParams) error
- func (q *Queries) UpdateSpecBundleLastRefAt(ctx context.Context, id string) error
- func (q *Queries) UpdateWaveCompletion(ctx context.Context, arg UpdateWaveCompletionParams) error
- func (q *Queries) UpdateWaveStatus(ctx context.Context, arg UpdateWaveStatusParams) error
- func (q *Queries) UpsertConfigBundleMap(ctx context.Context, arg UpsertConfigBundleMapParams) error
- func (q *Queries) UpsertConfigIn(ctx context.Context, arg UpsertConfigInParams) error
- func (q *Queries) UpsertGlobalEnv(ctx context.Context, arg UpsertGlobalEnvParams) error
- func (q *Queries) UpsertJobMetric(ctx context.Context, arg UpsertJobMetricParams) error
- func (q *Queries) UpsertMigRepo(ctx context.Context, arg UpsertMigRepoParams) (MigRepo, error)
- func (q *Queries) UpsertNodeDiagnostic(ctx context.Context, arg UpsertNodeDiagnosticParams) (NodeDiagnostic, error)
- func (q *Queries) UpsertSBOMRow(ctx context.Context, arg UpsertSBOMRowParams) error
- func (q *Queries) WithTx(tx pgx.Tx) *Queries
- type Repo
- type ResolveLatestNamedSpecByDomainRepoNameParams
- type ResolveLatestNamedSpecByDomainRepoNameRow
- type ResolveLatestNamedSpecByNameParams
- type ResolveLatestNamedSpecByNameRow
- type ResolveLatestNamedSpecByRepoNameParams
- type ResolveLatestNamedSpecByRepoNameRow
- type ResolveNamedSpecVersionByDomainRepoNameParams
- type ResolveNamedSpecVersionByNameParams
- type ResolveNamedSpecVersionByRepoNameParams
- type RestartRunParams
- type Run
- type RunsTiming
- type Sbom
- type ScheduleNextJobParams
- type Spec
- type SpecBundle
- type Store
- type TrimNodeDaemonLogsParams
- type UnclaimJobParams
- type UpdateJobCompletionParams
- type UpdateJobCompletionWithMetaParams
- type UpdateJobImageNameParams
- type UpdateJobMetaParams
- type UpdateJobNextIDParams
- type UpdateJobRepoSHAInParams
- type UpdateJobStatusParams
- type UpdateMigRepoBaseRefParams
- type UpdateMigSpecParams
- type UpdateNamedSpecArchiveStateParams
- type UpdateNodeCertMetadataParams
- type UpdateNodeDrainedParams
- type UpdateNodeHeartbeatParams
- type UpdateRunBaseRefParams
- type UpdateRunErrorParams
- type UpdateRunStatusParams
- type UpdateWaveCompletionParams
- type UpdateWaveStatusParams
- type UpsertConfigBundleMapParams
- type UpsertConfigInParams
- type UpsertGlobalEnvParams
- type UpsertJobMetricParams
- type UpsertMigRepoParams
- type UpsertNodeDiagnosticParams
- type UpsertSBOMRowParams
- type Wave
Constants ¶
const ( // TargetSchemaVersion is the highest embedded Tern migration version. TargetSchemaVersion int32 = 6 )
Variables ¶
var ErrBootstrapNodeExists = errors.New("store: bootstrap node already exists")
ErrBootstrapNodeExists is returned when bootstrap completion targets an already-enrolled node ID.
var ErrBootstrapTokenInvalid = errors.New("store: bootstrap token invalid")
ErrBootstrapTokenInvalid is returned when a bootstrap token is missing, revoked, already consumed, or bound to a different node.
var ErrEmptyNodeID = errors.New("store: ClaimJob requires non-empty nodeID")
ErrEmptyNodeID is returned when ClaimJob is called with an empty NodeID.
var ErrInvalidJSON = errors.New("store: invalid JSON for JSONB column")
ErrInvalidJSON is returned when a JSONB column receives invalid JSON bytes.
var ErrRunRestartActive = errors.New("store: only terminal runs can be restarted")
ErrRunRestartActive is returned when a non-terminal run is restarted.
var ErrRunRestartWaveCancelled = errors.New("store: cannot restart a run in a cancelled wave")
ErrRunRestartWaveCancelled is returned when the owning wave was cancelled.
var ErrUnsupportedSchema = errors.New("store: unsupported database schema for Tern adoption")
ErrUnsupportedSchema is returned when an existing database cannot be safely baselined into the Tern migration chain.
Functions ¶
func CurrentSchemaVersion ¶
CurrentSchemaVersion returns the applied Tern schema version.
func FromPGUUID ¶
FromPGUUID converts a pgtype.UUID to a string-like domain identifier. When the input is not valid, it returns the zero value for S (empty string).
func RunMigrations ¶
RunMigrations applies embedded Tern migrations. Existing databases from the final custom migration state are baselined at Tern version 1 so cleanup migration 2 can run normally on adoption.
Types ¶
type ApiToken ¶
type ApiToken struct {
ID pgtype.UUID `json:"id"`
TokenHash string `json:"token_hash"`
TokenID string `json:"token_id"`
Role string `json:"role"`
Username *string `json:"username"`
Description *string `json:"description"`
IssuedAt pgtype.Timestamptz `json:"issued_at"`
ExpiresAt pgtype.Timestamptz `json:"expires_at"`
LastUsedAt pgtype.Timestamptz `json:"last_used_at"`
RevokedAt pgtype.Timestamptz `json:"revoked_at"`
CreatedBy *string `json:"created_by"`
CreatedAt pgtype.Timestamptz `json:"created_at"`
}
type ArtifactBundle ¶
type ArtifactBundle struct {
ID pgtype.UUID `json:"id"`
RunID types.RunID `json:"run_id"`
JobID *types.JobID `json:"job_id"`
Name *string `json:"name"`
BundleSize int64 `json:"bundle_size"`
ObjectKey *string `json:"object_key"`
Cid *string `json:"cid"`
Digest *string `json:"digest"`
CreatedAt pgtype.Timestamptz `json:"created_at"`
}
type BootstrapToken ¶
type BootstrapToken struct {
ID pgtype.UUID `json:"id"`
TokenHash string `json:"token_hash"`
TokenID string `json:"token_id"`
NodeID *types.NodeID `json:"node_id"`
IssuedAt pgtype.Timestamptz `json:"issued_at"`
ExpiresAt pgtype.Timestamptz `json:"expires_at"`
UsedAt pgtype.Timestamptz `json:"used_at"`
CertIssuedAt pgtype.Timestamptz `json:"cert_issued_at"`
RevokedAt pgtype.Timestamptz `json:"revoked_at"`
IssuedBy *string `json:"issued_by"`
}
type CompleteBootstrapEnrollmentParams ¶
type CompleteBootstrapEnrollmentParams struct {
TokenID string
NodeID types.NodeID
CertSerial string
CertFingerprint string
CertNotBefore time.Time
CertNotAfter time.Time
}
CompleteBootstrapEnrollmentParams contains the certificate metadata recorded when a one-time bootstrap token successfully enrolls a new node.
type ConfigBundleMap ¶
type ConfigBundleMap struct {
Hash string `json:"hash"`
BundleID string `json:"bundle_id"`
UpdatedAt pgtype.Timestamptz `json:"updated_at"`
}
type ConfigIn ¶
type ConfigIn struct {
Entry string `json:"entry"`
Dst string `json:"dst"`
Section string `json:"section"`
UpdatedAt pgtype.Timestamptz `json:"updated_at"`
}
type CreateDiffParams ¶
type CreateEventParams ¶
type CreateJobParams ¶
type CreateJobParams struct {
ID types.JobID `json:"id"`
RunID types.RunID `json:"run_id"`
RepoID types.RepoID `json:"repo_id"`
RepoBaseRef string `json:"repo_base_ref"`
Attempt int32 `json:"attempt"`
Status types.JobStatus `json:"status"`
JobType types.JobType `json:"job_type"`
JobImage string `json:"job_image"`
NextID *types.JobID `json:"next_id"`
Name string `json:"name"`
Meta []byte `json:"meta"`
RepoShaIn string `json:"repo_sha_in"`
}
type CreateLogParams ¶
type CreateMigParams ¶
type CreateMigRepoParams ¶
type CreateNamedSpecParams ¶
type CreateNamedSpecParams struct {
ID types.SpecID `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
Source []byte `json:"source"`
Sha string `json:"sha"`
SourceCommittedAt pgtype.Timestamptz `json:"source_committed_at"`
Spec []byte `json:"spec"`
CreatedBy *string `json:"created_by"`
}
type CreateNodeParams ¶
type CreateRunParams ¶
type CreateRunParams struct {
ID types.RunID `json:"id"`
WaveID types.WaveID `json:"wave_id"`
MigID types.MigID `json:"mig_id"`
SpecID types.SpecID `json:"spec_id"`
RepoID types.RepoID `json:"repo_id"`
RepoBaseRef string `json:"repo_base_ref"`
SourceCommitSha string `json:"source_commit_sha"`
RepoSha0 string `json:"repo_sha0"`
CreatedBy *string `json:"created_by"`
Stats interface{} `json:"stats"`
}
type CreateSpecBundleParams ¶
type CreateSpecParams ¶
type CreateWaveParams ¶
type CreateWaveWithRunsParams ¶
type CreateWaveWithRunsParams struct {
Wave CreateWaveParams
Runs []CreateRunParams
}
CreateWaveWithRunsParams contains the complete DB materialization for one launch.
type DeleteConfigInParams ¶
type DeleteGlobalEnvParams ¶
type GetAPITokenByIDRow ¶
type GetAPITokenByIDRow struct {
TokenID string `json:"token_id"`
Role string `json:"role"`
Username *string `json:"username"`
Description *string `json:"description"`
IssuedAt pgtype.Timestamptz `json:"issued_at"`
ExpiresAt pgtype.Timestamptz `json:"expires_at"`
LastUsedAt pgtype.Timestamptz `json:"last_used_at"`
RevokedAt pgtype.Timestamptz `json:"revoked_at"`
CreatedBy *string `json:"created_by"`
}
type GetBootstrapTokenRow ¶
type GetBootstrapTokenRow struct {
NodeID *types.NodeID `json:"node_id"`
IssuedAt pgtype.Timestamptz `json:"issued_at"`
ExpiresAt pgtype.Timestamptz `json:"expires_at"`
UsedAt pgtype.Timestamptz `json:"used_at"`
CertIssuedAt pgtype.Timestamptz `json:"cert_issued_at"`
RevokedAt pgtype.Timestamptz `json:"revoked_at"`
}
type GetGlobalEnvParams ¶
type GetMigRepoByURLParams ¶
type IncrementRunAttemptParams ¶ added in v0.1.16
type InsertAPITokenParams ¶
type InsertAPITokenParams struct {
TokenHash string `json:"token_hash"`
TokenID string `json:"token_id"`
Role string `json:"role"`
Username *string `json:"username"`
Description *string `json:"description"`
IssuedAt pgtype.Timestamptz `json:"issued_at"`
ExpiresAt pgtype.Timestamptz `json:"expires_at"`
CreatedBy *string `json:"created_by"`
}
type InsertBootstrapTokenParams ¶
type InsertBootstrapTokenParams struct {
TokenHash string `json:"token_hash"`
TokenID string `json:"token_id"`
NodeID *types.NodeID `json:"node_id"`
IssuedAt pgtype.Timestamptz `json:"issued_at"`
ExpiresAt pgtype.Timestamptz `json:"expires_at"`
IssuedBy *string `json:"issued_by"`
}
type Job ¶
type Job struct {
ID types.JobID `json:"id"`
RunID types.RunID `json:"run_id"`
RepoID types.RepoID `json:"repo_id"`
RepoBaseRef string `json:"repo_base_ref"`
Attempt int32 `json:"attempt"`
Status types.JobStatus `json:"status"`
JobType types.JobType `json:"job_type"`
JobImage string `json:"job_image"`
NextID *types.JobID `json:"next_id"`
Name string `json:"name"`
NodeID *types.NodeID `json:"node_id"`
ExitCode *int32 `json:"exit_code"`
StartedAt pgtype.Timestamptz `json:"started_at"`
FinishedAt pgtype.Timestamptz `json:"finished_at"`
DurationMs int64 `json:"duration_ms"`
RepoShaIn string `json:"repo_sha_in"`
RepoShaOut string `json:"repo_sha_out"`
RepoShaIn8 string `json:"repo_sha_in8"`
RepoShaOut8 string `json:"repo_sha_out8"`
Meta []byte `json:"meta"`
}
type JobMetric ¶
type JobMetric struct {
ID int64 `json:"id"`
NodeID types.NodeID `json:"node_id"`
JobID types.JobID `json:"job_id"`
CreatedAt pgtype.Timestamptz `json:"created_at"`
CpuConsumedNs int64 `json:"cpu_consumed_ns"`
DiskConsumedBytes int64 `json:"disk_consumed_bytes"`
MemConsumedBytes int64 `json:"mem_consumed_bytes"`
}
type ListAPITokensRow ¶
type ListAPITokensRow struct {
TokenID string `json:"token_id"`
Role string `json:"role"`
Username *string `json:"username"`
Description *string `json:"description"`
IssuedAt pgtype.Timestamptz `json:"issued_at"`
ExpiresAt pgtype.Timestamptz `json:"expires_at"`
LastUsedAt pgtype.Timestamptz `json:"last_used_at"`
RevokedAt pgtype.Timestamptz `json:"revoked_at"`
CreatedBy *string `json:"created_by"`
}
type ListDistinctReposRow ¶
type ListDistinctReposRow struct {
RepoID types.RepoID `json:"repo_id"`
RepoUrl string `json:"repo_url"`
LastRunAt pgtype.Timestamptz `json:"last_run_at"`
LastStatus interface{} `json:"last_status"`
}
type ListJobsForTUIParams ¶
type ListJobsForTUIRow ¶
type ListJobsForTUIRow struct {
JobID types.JobID `json:"job_id"`
Name string `json:"name"`
JobType types.JobType `json:"job_type"`
Status types.JobStatus `json:"status"`
DurationMs int64 `json:"duration_ms"`
JobImage string `json:"job_image"`
NodeID *types.NodeID `json:"node_id"`
MigName string `json:"mig_name"`
RunID types.RunID `json:"run_id"`
RepoID types.RepoID `json:"repo_id"`
}
type ListLatestNamedSpecsRow ¶
type ListLatestNamedSpecsRow struct {
ID string `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
Source []byte `json:"source"`
Sha string `json:"sha"`
SourceCommittedAt pgtype.Timestamptz `json:"source_committed_at"`
Spec []byte `json:"spec"`
CreatedBy *string `json:"created_by"`
UpdatedBy *string `json:"updated_by"`
CreatedAt pgtype.Timestamptz `json:"created_at"`
ArchivedAt pgtype.Timestamptz `json:"archived_at"`
}
type ListMigsParams ¶
type ListRunsForRepoParams ¶
type ListRunsForRepoRow ¶
type ListRunsForRepoRow struct {
RunID types.RunID `json:"run_id"`
WaveID types.WaveID `json:"wave_id"`
MigID types.MigID `json:"mig_id"`
Status types.RunStatus `json:"status"`
RepoBaseRef string `json:"repo_base_ref"`
Attempt int32 `json:"attempt"`
StartedAt pgtype.Timestamptz `json:"started_at"`
FinishedAt pgtype.Timestamptz `json:"finished_at"`
}
type ListRunsParams ¶
type ListRunsTimingsParams ¶
type ListRunsWithMetadataRow ¶
type ListRunsWithMetadataRow struct {
ID types.RunID `json:"id"`
WaveID types.WaveID `json:"wave_id"`
MigID types.MigID `json:"mig_id"`
SpecID types.SpecID `json:"spec_id"`
RepoID types.RepoID `json:"repo_id"`
RepoBaseRef string `json:"repo_base_ref"`
SourceCommitSha string `json:"source_commit_sha"`
RepoSha0 string `json:"repo_sha0"`
CreatedBy *string `json:"created_by"`
Status types.RunStatus `json:"status"`
Attempt int32 `json:"attempt"`
LastError *string `json:"last_error"`
CreatedAt pgtype.Timestamptz `json:"created_at"`
StartedAt pgtype.Timestamptz `json:"started_at"`
FinishedAt pgtype.Timestamptz `json:"finished_at"`
Stats []byte `json:"stats"`
RepoUrl string `json:"repo_url"`
SpecName string `json:"spec_name"`
SpecSourceDomain string `json:"spec_source_domain"`
SpecSourceRepo string `json:"spec_source_repo"`
}
type ListRunsWithURLByWaveRow ¶
type ListRunsWithURLByWaveRow struct {
ID types.RunID `json:"id"`
WaveID types.WaveID `json:"wave_id"`
MigID types.MigID `json:"mig_id"`
SpecID types.SpecID `json:"spec_id"`
RepoID types.RepoID `json:"repo_id"`
RepoBaseRef string `json:"repo_base_ref"`
SourceCommitSha string `json:"source_commit_sha"`
RepoSha0 string `json:"repo_sha0"`
CreatedBy *string `json:"created_by"`
Status types.RunStatus `json:"status"`
Attempt int32 `json:"attempt"`
LastError *string `json:"last_error"`
CreatedAt pgtype.Timestamptz `json:"created_at"`
StartedAt pgtype.Timestamptz `json:"started_at"`
FinishedAt pgtype.Timestamptz `json:"finished_at"`
Stats []byte `json:"stats"`
RepoUrl string `json:"repo_url"`
}
type ListSpecBundlesParams ¶
type ListSpecsParams ¶
type ListStaleRunningJobsRow ¶
type ListWavesByMigParams ¶
type ListWavesParams ¶
type Mig ¶
type Mig struct {
ID types.MigID `json:"id"`
Name string `json:"name"`
SpecID *types.SpecID `json:"spec_id"`
CreatedBy *string `json:"created_by"`
CreatedAt pgtype.Timestamptz `json:"created_at"`
ArchivedAt pgtype.Timestamptz `json:"archived_at"`
}
type Node ¶
type Node struct {
ID types.NodeID `json:"id"`
Name string `json:"name"`
IpAddress netip.Addr `json:"ip_address"`
Version *string `json:"version"`
Concurrency int32 `json:"concurrency"`
CpuTotalMillis int32 `json:"cpu_total_millis"`
CpuFreeMillis int32 `json:"cpu_free_millis"`
MemTotalBytes int64 `json:"mem_total_bytes"`
MemFreeBytes int64 `json:"mem_free_bytes"`
DiskTotalBytes int64 `json:"disk_total_bytes"`
DiskFreeBytes int64 `json:"disk_free_bytes"`
Drained bool `json:"drained"`
CertSerial *string `json:"cert_serial"`
CertFingerprint *string `json:"cert_fingerprint"`
CertNotBefore pgtype.Timestamptz `json:"cert_not_before"`
CertNotAfter pgtype.Timestamptz `json:"cert_not_after"`
LastHeartbeat pgtype.Timestamptz `json:"last_heartbeat"`
CreatedAt pgtype.Timestamptz `json:"created_at"`
}
type NodeDaemonLog ¶
type NodeDiagnostic ¶
type NodeDiagnostic struct {
NodeID types.NodeID `json:"node_id"`
Component string `json:"component"`
Status string `json:"status"`
LastError *string `json:"last_error"`
Version *string `json:"version"`
ImageRef *string `json:"image_ref"`
LocalImageID *string `json:"local_image_id"`
RemoteImageID *string `json:"remote_image_id"`
Details []byte `json:"details"`
LastCheckedAt pgtype.Timestamptz `json:"last_checked_at"`
LastSuccessAt pgtype.Timestamptz `json:"last_success_at"`
UpdatedAt pgtype.Timestamptz `json:"updated_at"`
}
type NodeMetric ¶
type NodeMetric struct {
ID int64 `json:"id"`
NodeID types.NodeID `json:"node_id"`
CreatedAt pgtype.Timestamptz `json:"created_at"`
CpuTotalMillis int32 `json:"cpu_total_millis"`
CpuFreeMillis int32 `json:"cpu_free_millis"`
MemTotalBytes int64 `json:"mem_total_bytes"`
MemFreeBytes int64 `json:"mem_free_bytes"`
DiskTotalBytes int64 `json:"disk_total_bytes"`
DiskFreeBytes int64 `json:"disk_free_bytes"`
}
type PgStore ¶
type PgStore struct {
*Queries
// contains filtered or unexported fields
}
PgStore wraps a pgxpool connection pool and implements Store.
func (*PgStore) CancelWave ¶
CancelWave atomically cancels one wave and all active child runs/jobs.
func (*PgStore) ClaimJob ¶
ClaimJob atomically claims the next claimable job for a node. Requires a non-empty nodeID; returns ErrEmptyNodeID if the nodeID is empty. This prevents jobs from entering Running state with node_id=NULL.
func (*PgStore) CompleteBootstrapEnrollment ¶
func (s *PgStore) CompleteBootstrapEnrollment(ctx context.Context, arg CompleteBootstrapEnrollmentParams) error
CompleteBootstrapEnrollment atomically consumes one bootstrap token and creates the node it was minted for.
func (*PgStore) CreateDiff ¶
CreateDiff validates the Summary JSONB field and creates a new diff.
func (*PgStore) CreateNamedSpec ¶
CreateNamedSpec validates JSONB fields and creates a new named spec.
func (*PgStore) CreateRun ¶ added in v0.1.16
CreateRun validates the Stats JSONB field and creates a run.
func (*PgStore) CreateSpec ¶
CreateSpec validates the Spec JSONB field and creates a new spec.
func (*PgStore) CreateWaveWithRuns ¶
func (s *PgStore) CreateWaveWithRuns(ctx context.Context, arg CreateWaveWithRunsParams) (Wave, []Run, error)
CreateWaveWithRuns atomically creates a wave and its selected run rows.
func (*PgStore) Pool ¶
Pool returns the underlying connection pool. This is useful for operations that need direct pool access, such as partition management.
func (*PgStore) RestartRun ¶
RestartRun atomically resets one terminal run to Queued on the next attempt.
func (*PgStore) UnclaimJob ¶
func (s *PgStore) UnclaimJob(ctx context.Context, arg UnclaimJobParams) error
UnclaimJob reverts a claimed Running job back to claimable Queued state. The update is guarded by both job ID and node ID to avoid stealing claims.
func (*PgStore) UpdateJobCompletionWithMeta ¶
func (s *PgStore) UpdateJobCompletionWithMeta(ctx context.Context, arg UpdateJobCompletionWithMetaParams) error
UpdateJobCompletionWithMeta validates the Meta JSONB field and completes a job with metadata.
func (*PgStore) UpdateJobMeta ¶
func (s *PgStore) UpdateJobMeta(ctx context.Context, arg UpdateJobMetaParams) error
UpdateJobMeta validates the Meta JSONB field and updates job metadata.
func (*PgStore) UpdateWaveCompletion ¶
func (s *PgStore) UpdateWaveCompletion(ctx context.Context, arg UpdateWaveCompletionParams) error
UpdateWaveCompletion validates the Stats JSONB field and completes a wave.
func (*PgStore) UpsertNodeDiagnostic ¶
func (s *PgStore) UpsertNodeDiagnostic(ctx context.Context, arg UpsertNodeDiagnosticParams) (NodeDiagnostic, error)
UpsertNodeDiagnostic validates the Details JSONB field and stores daemon state.
type Querier ¶
type Querier interface {
// Archives a mig by setting archived_at to now().
// Archiving must be refused when the mig has any jobs in a running state.
// This query only sets the timestamp; validation logic must be in the caller.
ArchiveMig(ctx context.Context, id types.MigID) error
// Bulk-cancels active jobs for a run (Created/Queued/Running -> Cancelled).
// finished_at is set once; duration_ms is computed from started_at when present.
CancelActiveJobsByRun(ctx context.Context, runID types.RunID) (int64, error)
// Bulk-cancels active jobs for a specific run attempt.
// Targets Created/Queued/Running and preserves terminal jobs.
// finished_at is set once; duration_ms is computed from started_at when present.
CancelActiveJobsByRunAttempt(ctx context.Context, arg CancelActiveJobsByRunAttemptParams) (int64, error)
CancelActiveRunsByWave(ctx context.Context, waveID types.WaveID) (int64, error)
CheckAPITokenRevoked(ctx context.Context, tokenID string) (pgtype.Timestamptz, error)
CheckBootstrapTokenRevoked(ctx context.Context, tokenID string) (pgtype.Timestamptz, error)
// Atomically claim the next claimable job for a node.
ClaimJob(ctx context.Context, nodeID types.NodeID) (Job, error)
ClearRepoSHAChainFromJob(ctx context.Context, arg ClearRepoSHAChainFromJobParams) (int64, error)
CountJobsByRun(ctx context.Context, runID types.RunID) (int64, error)
CountJobsByRunAndStatus(ctx context.Context, arg CountJobsByRunAndStatusParams) (int64, error)
// Counts jobs by status for a specific run attempt.
// Used by terminal detection to determine runs.status.
CountJobsByRunAttemptGroupByStatus(ctx context.Context, arg CountJobsByRunAttemptGroupByStatusParams) ([]CountJobsByRunAttemptGroupByStatusRow, error)
// Counts jobs with optional run_id filter.
// run_id: if non-null, count jobs for that run; if null, count all jobs.
// Used with ListJobsForTUI to provide total for TUI pagination.
CountJobsForTUI(ctx context.Context, runID *string) (int64, error)
CountRunsByWaveStatus(ctx context.Context, waveID types.WaveID) ([]CountRunsByWaveStatusRow, error)
// Counts distinct stale nodes that currently have at least one running job.
// Excludes NULL node_id rows (orphaned running jobs) from node count.
CountStaleNodesWithRunningJobs(ctx context.Context, lastHeartbeat pgtype.Timestamptz) (int64, error)
// Creates a new artifact bundle metadata. Blob data is stored in object storage.
// Bundles are grouped at the job level only (build_id removed).
CreateArtifactBundle(ctx context.Context, arg CreateArtifactBundleParams) (ArtifactBundle, error)
// Creates a new diff entry associated with a job. Blob data is stored in object storage.
CreateDiff(ctx context.Context, arg CreateDiffParams) (Diff, error)
CreateEvent(ctx context.Context, arg CreateEventParams) (Event, error)
// Note: `id` is a required TEXT parameter (KSUID-backed); caller generates via types.NewJobID().
CreateJob(ctx context.Context, arg CreateJobParams) (Job, error)
// Creates a new log chunk metadata. Blob data is stored in object storage.
// Logs are grouped at the job level only (build_id removed).
CreateLog(ctx context.Context, arg CreateLogParams) (Log, error)
CreateMig(ctx context.Context, arg CreateMigParams) (Mig, error)
CreateMigRepo(ctx context.Context, arg CreateMigRepoParams) (MigRepo, error)
CreateNamedSpec(ctx context.Context, arg CreateNamedSpecParams) (Spec, error)
// Creates a new node with an application-supplied URL-safe ID as the primary key.
CreateNode(ctx context.Context, arg CreateNodeParams) (Node, error)
CreateNodeDaemonLog(ctx context.Context, arg CreateNodeDaemonLogParams) (NodeDaemonLog, error)
CreateRun(ctx context.Context, arg CreateRunParams) (Run, error)
CreateSpec(ctx context.Context, arg CreateSpecParams) (Spec, error)
// Creates a new spec bundle metadata row. Blob data is stored in object storage.
CreateSpecBundle(ctx context.Context, arg CreateSpecBundleParams) (SpecBundle, error)
CreateWave(ctx context.Context, arg CreateWaveParams) (Wave, error)
DeleteArtifactBundle(ctx context.Context, id pgtype.UUID) error
DeleteArtifactBundlesOlderThan(ctx context.Context, createdAt pgtype.Timestamptz) error
// Removes a bundle map entry by hash.
DeleteConfigBundleMap(ctx context.Context, hash string) error
// Removes an in entry by dst and section.
DeleteConfigIn(ctx context.Context, arg DeleteConfigInParams) error
// Removes all in entries for a section.
DeleteConfigInBySection(ctx context.Context, section string) error
DeleteDiff(ctx context.Context, id pgtype.UUID) error
DeleteDiffsOlderThan(ctx context.Context, createdAt pgtype.Timestamptz) error
// DeleteExpiredArtifactBundles removes artifact bundle rows older than the specified timestamp.
DeleteExpiredArtifactBundles(ctx context.Context, createdAt pgtype.Timestamptz) (int64, error)
// DeleteExpiredDiffs removes diff rows older than the specified timestamp.
DeleteExpiredDiffs(ctx context.Context, createdAt pgtype.Timestamptz) (int64, error)
// DeleteExpiredEvents removes event rows older than the specified timestamp.
DeleteExpiredEvents(ctx context.Context, time pgtype.Timestamptz) (int64, error)
// DeleteExpiredLogs removes log rows older than the specified timestamp.
DeleteExpiredLogs(ctx context.Context, createdAt pgtype.Timestamptz) (int64, error)
// Removes an environment entry by key and target.
// No-op if the (key, target) pair does not exist (exec returns no error).
DeleteGlobalEnv(ctx context.Context, arg DeleteGlobalEnvParams) error
DeleteJob(ctx context.Context, id types.JobID) error
DeleteLog(ctx context.Context, id int64) error
DeleteLogsOlderThan(ctx context.Context, createdAt pgtype.Timestamptz) error
// Deletes a mig. Use with caution; should only be called when safe to remove.
DeleteMig(ctx context.Context, id types.MigID) error
// Deletes a mig_repo by id.
// Note: mig_repos.id remains referenced by API-level repo membership records.
DeleteMigRepo(ctx context.Context, id types.MigRepoID) error
DeleteNode(ctx context.Context, id types.NodeID) error
DeleteRun(ctx context.Context, id types.RunID) error
DeleteSBOMRowsByJob(ctx context.Context, jobID types.JobID) error
// Deletes a spec bundle metadata row by ID.
// Called by blobpersist as rollback when object storage upload fails.
DeleteSpecBundle(ctx context.Context, id string) error
DeleteWave(ctx context.Context, id types.WaveID) error
GetAPITokenByID(ctx context.Context, tokenID string) (GetAPITokenByIDRow, error)
// Transitional: returns current job id and linked successor id.
GetAdjacentJobIndices(ctx context.Context, id types.JobID) (GetAdjacentJobIndicesRow, error)
// Returns artifact bundle metadata including object_key for object-storage retrieval.
GetArtifactBundle(ctx context.Context, id pgtype.UUID) (ArtifactBundle, error)
GetBootstrapToken(ctx context.Context, tokenID string) (GetBootstrapTokenRow, error)
GetEvent(ctx context.Context, id int64) (Event, error)
// Retrieves a single environment entry by key and target.
// Returns pgx.ErrNoRows if the (key, target) pair does not exist.
GetGlobalEnv(ctx context.Context, arg GetGlobalEnvParams) (ConfigEnv, error)
GetJob(ctx context.Context, id types.JobID) (Job, error)
GetLatestDiffByJob(ctx context.Context, jobID *types.JobID) (Diff, error)
GetLatestRunByMigAndRepoStatus(ctx context.Context, arg GetLatestRunByMigAndRepoStatusParams) (GetLatestRunByMigAndRepoStatusRow, error)
// Returns log metadata including object_key for object-storage retrieval.
GetLog(ctx context.Context, id int64) (Log, error)
GetMig(ctx context.Context, id types.MigID) (Mig, error)
GetMigByName(ctx context.Context, name string) (Mig, error)
GetMigRepo(ctx context.Context, id types.MigRepoID) (MigRepo, error)
// Gets a mig_repo by mig_id and repo_url (for uniqueness constraint enforcement).
GetMigRepoByURL(ctx context.Context, arg GetMigRepoByURLParams) (MigRepo, error)
GetNamedSpecByNameSourceSHA(ctx context.Context, arg GetNamedSpecByNameSourceSHAParams) (Spec, error)
GetNode(ctx context.Context, id types.NodeID) (Node, error)
GetRepo(ctx context.Context, id types.RepoID) (Repo, error)
GetRun(ctx context.Context, id types.RunID) (Run, error)
GetRunSnapshotMetadata(ctx context.Context, id types.RunID) (GetRunSnapshotMetadataRow, error)
GetRunTiming(ctx context.Context, id types.RunID) (RunsTiming, error)
GetSpec(ctx context.Context, id types.SpecID) (Spec, error)
// Returns spec bundle metadata including object_key for object-storage retrieval.
GetSpecBundle(ctx context.Context, id string) (SpecBundle, error)
// Returns the most recently created spec bundle for a given cid.
// Used for deduplication: callers should check by CID before uploading.
GetSpecBundleByCID(ctx context.Context, cid string) (SpecBundle, error)
GetWave(ctx context.Context, id types.WaveID) (Wave, error)
// Checks if a mig_repo has any historical executions.
// Returns true if the repo cannot be deleted due to history, false otherwise.
HasMigRepoHistory(ctx context.Context, repoID types.RepoID) (bool, error)
HasRunningJobForRunNode(ctx context.Context, arg HasRunningJobForRunNodeParams) (bool, error)
IncrementRunAttempt(ctx context.Context, arg IncrementRunAttemptParams) error
InsertAPIToken(ctx context.Context, arg InsertAPITokenParams) error
InsertBootstrapToken(ctx context.Context, arg InsertBootstrapTokenParams) error
ListAPITokens(ctx context.Context) ([]ListAPITokensRow, error)
// ListArtifactBundlePartitions retrieves all partition names for the artifact_bundles table.
ListArtifactBundlePartitions(ctx context.Context) ([]string, error)
// Returns artifact bundle metadata including object_key for object-storage retrieval.
ListArtifactBundlesByCID(ctx context.Context, cid *string) ([]ArtifactBundle, error)
// Returns artifact bundle metadata including object_key for object-storage retrieval.
ListArtifactBundlesByRun(ctx context.Context, runID types.RunID) ([]ArtifactBundle, error)
// Returns artifact bundle metadata including object_key for object-storage retrieval.
ListArtifactBundlesByRunAndJob(ctx context.Context, arg ListArtifactBundlesByRunAndJobParams) ([]ArtifactBundle, error)
// config_bundle_map.sql — CRUD queries for global bundle map entries (config_bundle_map table).
// Provides ListConfigBundleMap, UpsertConfigBundleMap, DeleteConfigBundleMap.
// Returns all bundle map entries ordered by hash for deterministic iteration.
ListConfigBundleMap(ctx context.Context) ([]ConfigBundleMap, error)
// config_in.sql — CRUD queries for global in mount entries (config_in table).
// Provides ListConfigIn, UpsertConfigIn, DeleteConfigIn, DeleteConfigInBySection.
// Returns all in entries ordered by section then dst for deterministic iteration.
ListConfigIn(ctx context.Context) ([]ConfigIn, error)
// Returns in entries for a specific section ordered by dst.
ListConfigInBySection(ctx context.Context, section string) ([]ConfigIn, error)
ListCreatedJobsByRunAttempt(ctx context.Context, arg ListCreatedJobsByRunAttemptParams) ([]Job, error)
// Returns diff metadata for a run.
ListDiffsByRun(ctx context.Context, runID types.RunID) ([]Diff, error)
// Lists distinct repos for a mig with last known run metadata,
// optionally filtered by repo_url substring.
ListDistinctRepos(ctx context.Context, filter string) ([]ListDistinctReposRow, error)
// ListEventPartitions retrieves all partition names for the events table.
ListEventPartitions(ctx context.Context) ([]string, error)
ListEventsByRun(ctx context.Context, runID types.RunID) ([]Event, error)
ListEventsByRunSince(ctx context.Context, arg ListEventsByRunSinceParams) ([]Event, error)
ListFailedRepoIDsByMig(ctx context.Context, migID types.MigID) ([]types.RepoID, error)
// config_env.sql — CRUD queries for global environment variables (config_env table).
// Provides ListGlobalEnv, GetGlobalEnv, UpsertGlobalEnv, DeleteGlobalEnv.
// Returns all global environment entries, ordered by key then target for consistent iteration.
// Used by ConfigHolder initialization and HTTP list endpoint.
ListGlobalEnv(ctx context.Context) ([]ConfigEnv, error)
ListJobsByRun(ctx context.Context, runID types.RunID) ([]Job, error)
ListJobsByRunAttempt(ctx context.Context, arg ListJobsByRunAttemptParams) ([]Job, error)
// Lists jobs with optional run_id filter, ordered newest-to-oldest by job id.
// run_id: if non-null, filter to jobs for that run; if null, return all jobs.
// Joins runs and migs to surface mig_name per job for the TUI jobs-list screen.
ListJobsForTUI(ctx context.Context, arg ListJobsForTUIParams) ([]ListJobsForTUIRow, error)
ListLatestNamedSpecs(ctx context.Context, arg ListLatestNamedSpecsParams) ([]ListLatestNamedSpecsRow, error)
// ListLogPartitions retrieves all partition names for the logs table.
ListLogPartitions(ctx context.Context) ([]string, error)
// Returns log metadata including object_key for object-storage retrieval.
ListLogsByRun(ctx context.Context, runID types.RunID) ([]Log, error)
// Returns log metadata including object_key for object-storage retrieval.
ListLogsByRunAndJob(ctx context.Context, arg ListLogsByRunAndJobParams) ([]Log, error)
// Returns log metadata including object_key for object-storage retrieval.
ListLogsByRunAndJobSince(ctx context.Context, arg ListLogsByRunAndJobSinceParams) ([]Log, error)
// Returns log metadata including object_key for object-storage retrieval.
ListLogsByRunSince(ctx context.Context, arg ListLogsByRunSinceParams) ([]Log, error)
ListMigReposByMig(ctx context.Context, migID types.MigID) ([]MigRepo, error)
// Lists migs with optional filtering by archived status and name substring.
// archived_only: if true, return only archived migs; if false, return only active migs; if null, return all.
// name_filter: if non-empty, filter by name substring (case-insensitive); if null/empty, no name filtering.
ListMigs(ctx context.Context, arg ListMigsParams) ([]Mig, error)
ListNodeDaemonLogs(ctx context.Context, arg ListNodeDaemonLogsParams) ([]NodeDaemonLog, error)
ListNodeDiagnostics(ctx context.Context, nodeID types.NodeID) ([]NodeDiagnostic, error)
// ListNodeMetricsPartitions retrieves all partition names for the node_metrics table.
ListNodeMetricsPartitions(ctx context.Context) ([]string, error)
ListNodes(ctx context.Context) ([]Node, error)
ListQueuedRunsByWave(ctx context.Context, waveID types.WaveID) ([]Run, error)
ListRunSBOMRowsByJobType(ctx context.Context, arg ListRunSBOMRowsByJobTypeParams) ([]ListRunSBOMRowsByJobTypeRow, error)
ListRuns(ctx context.Context, arg ListRunsParams) ([]Run, error)
ListRunsByWave(ctx context.Context, waveID types.WaveID) ([]Run, error)
ListRunsForRepo(ctx context.Context, arg ListRunsForRepoParams) ([]ListRunsForRepoRow, error)
ListRunsTimings(ctx context.Context, arg ListRunsTimingsParams) ([]RunsTiming, error)
ListRunsWithMetadata(ctx context.Context, arg ListRunsWithMetadataParams) ([]ListRunsWithMetadataRow, error)
ListRunsWithURLByWave(ctx context.Context, waveID types.WaveID) ([]ListRunsWithURLByWaveRow, error)
// Lists spec bundles ordered by created_at descending (most recent first).
ListSpecBundles(ctx context.Context, arg ListSpecBundlesParams) ([]SpecBundle, error)
// Lists spec bundles whose last_ref_at is before the given threshold.
// Used by GC to find bundles eligible for deletion.
ListSpecBundlesUnreferencedBefore(ctx context.Context, lastRefAt pgtype.Timestamptz) ([]SpecBundle, error)
// Lists specs ordered by created_at descending (most recent first).
// There is an index on created_at to optimize this query.
ListSpecs(ctx context.Context, arg ListSpecsParams) ([]Spec, error)
// Lists running jobs whose assigned node is stale at the provided cutoff.
// Rows are grouped by (run_id, attempt) for deterministic recovery processing.
ListStaleRunningJobs(ctx context.Context, lastHeartbeat pgtype.Timestamptz) ([]ListStaleRunningJobsRow, error)
ListWaves(ctx context.Context, arg ListWavesParams) ([]Wave, error)
ListWavesByMig(ctx context.Context, arg ListWavesByMigParams) ([]Wave, error)
ListWavesWithQueuedRuns(ctx context.Context) ([]types.WaveID, error)
MarkBootstrapTokenCertIssued(ctx context.Context, tokenID string) error
// Atomically promote a specific linked successor job: Created -> Queued.
// The candidate is eligible only when every predecessor that points to it is Success.
PromoteJobByIDIfUnblocked(ctx context.Context, id types.JobID) (Job, error)
ResolveLatestNamedSpecByDomainRepoName(ctx context.Context, arg ResolveLatestNamedSpecByDomainRepoNameParams) ([]ResolveLatestNamedSpecByDomainRepoNameRow, error)
ResolveLatestNamedSpecByName(ctx context.Context, arg ResolveLatestNamedSpecByNameParams) ([]ResolveLatestNamedSpecByNameRow, error)
ResolveLatestNamedSpecByRepoName(ctx context.Context, arg ResolveLatestNamedSpecByRepoNameParams) ([]ResolveLatestNamedSpecByRepoNameRow, error)
ResolveNamedSpecVersionByDomainRepoName(ctx context.Context, arg ResolveNamedSpecVersionByDomainRepoNameParams) ([]Spec, error)
ResolveNamedSpecVersionByName(ctx context.Context, arg ResolveNamedSpecVersionByNameParams) ([]Spec, error)
ResolveNamedSpecVersionByRepoName(ctx context.Context, arg ResolveNamedSpecVersionByRepoNameParams) ([]Spec, error)
RevokeAPIToken(ctx context.Context, tokenID string) error
// Atomically promote the next unblocked job in a run attempt: Created -> Queued.
// A created job is unblocked when all predecessor jobs that point to it are Success.
ScheduleNextJob(ctx context.Context, arg ScheduleNextJobParams) (Job, error)
TrimNodeDaemonLogs(ctx context.Context, arg TrimNodeDaemonLogsParams) error
// Unarchives a mig by clearing archived_at.
UnarchiveMig(ctx context.Context, id types.MigID) error
// Revert a claimed Running job back to claimable Queued state.
// Guarded by both job id and node id so a foreign node cannot steal the slot.
UnclaimJob(ctx context.Context, arg UnclaimJobParams) error
UpdateAPITokenLastUsed(ctx context.Context, tokenID string) error
UpdateBootstrapTokenLastUsed(ctx context.Context, tokenID string) error
UpdateJobCompletion(ctx context.Context, arg UpdateJobCompletionParams) error
UpdateJobCompletionWithMeta(ctx context.Context, arg UpdateJobCompletionWithMetaParams) error
// Persist the container image name used to execute a job.
// This is set by the node immediately before job execution starts.
UpdateJobImageName(ctx context.Context, arg UpdateJobImageNameParams) error
UpdateJobMeta(ctx context.Context, arg UpdateJobMetaParams) error
UpdateJobNextID(ctx context.Context, arg UpdateJobNextIDParams) error
UpdateJobRepoSHAIn(ctx context.Context, arg UpdateJobRepoSHAInParams) error
UpdateJobStatus(ctx context.Context, arg UpdateJobStatusParams) error
UpdateMigRepoBaseRef(ctx context.Context, arg UpdateMigRepoBaseRefParams) error
UpdateMigSpec(ctx context.Context, arg UpdateMigSpecParams) error
UpdateNamedSpecArchiveState(ctx context.Context, arg UpdateNamedSpecArchiveStateParams) (Spec, error)
UpdateNodeCertMetadata(ctx context.Context, arg UpdateNodeCertMetadataParams) error
UpdateNodeDrained(ctx context.Context, arg UpdateNodeDrainedParams) error
UpdateNodeHeartbeat(ctx context.Context, arg UpdateNodeHeartbeatParams) error
UpdateRunBaseRef(ctx context.Context, arg UpdateRunBaseRefParams) error
UpdateRunError(ctx context.Context, arg UpdateRunErrorParams) error
UpdateRunResume(ctx context.Context, id types.RunID) error
UpdateRunStatus(ctx context.Context, arg UpdateRunStatusParams) error
// Updates last_ref_at to now() for the given spec bundle.
// Call this whenever a spec or run references the bundle to keep GC metadata fresh.
UpdateSpecBundleLastRefAt(ctx context.Context, id string) error
UpdateWaveCompletion(ctx context.Context, arg UpdateWaveCompletionParams) error
UpdateWaveStatus(ctx context.Context, arg UpdateWaveStatusParams) error
// Inserts or updates a bundle map entry (upsert on primary key hash).
// Refreshes bundle_id and updated_at on conflict.
UpsertConfigBundleMap(ctx context.Context, arg UpsertConfigBundleMapParams) error
// Inserts or updates an in entry (upsert on composite key (dst, section)).
// Refreshes entry and updated_at on conflict (entry may change if hash changes).
UpsertConfigIn(ctx context.Context, arg UpsertConfigInParams) error
// Inserts or updates an environment entry (upsert on composite key (key, target)).
// Updates value, secret, and refreshes updated_at on conflict.
// This ensures idempotent set operations from the CLI or API.
UpsertGlobalEnv(ctx context.Context, arg UpsertGlobalEnvParams) error
UpsertJobMetric(ctx context.Context, arg UpsertJobMetricParams) error
// Bulk upsert a mig_repo by normalized repo_url.
// Uniqueness is on (mig_id, repo_id) to prevent duplicate repo membership per mig.
UpsertMigRepo(ctx context.Context, arg UpsertMigRepoParams) (MigRepo, error)
UpsertNodeDiagnostic(ctx context.Context, arg UpsertNodeDiagnosticParams) (NodeDiagnostic, error)
UpsertSBOMRow(ctx context.Context, arg UpsertSBOMRowParams) error
}
type Queries ¶
type Queries struct {
// contains filtered or unexported fields
}
func (*Queries) ArchiveMig ¶
Archives a mig by setting archived_at to now(). Archiving must be refused when the mig has any jobs in a running state. This query only sets the timestamp; validation logic must be in the caller.
func (*Queries) CancelActiveJobsByRun ¶
Bulk-cancels active jobs for a run (Created/Queued/Running -> Cancelled). finished_at is set once; duration_ms is computed from started_at when present.
func (*Queries) CancelActiveJobsByRunAttempt ¶
func (q *Queries) CancelActiveJobsByRunAttempt(ctx context.Context, arg CancelActiveJobsByRunAttemptParams) (int64, error)
Bulk-cancels active jobs for a specific run attempt. Targets Created/Queued/Running and preserves terminal jobs. finished_at is set once; duration_ms is computed from started_at when present.
func (*Queries) CancelActiveRunsByWave ¶
func (*Queries) CheckAPITokenRevoked ¶
func (*Queries) CheckBootstrapTokenRevoked ¶
func (*Queries) ClearRepoSHAChainFromJob ¶
func (*Queries) CountJobsByRun ¶
func (*Queries) CountJobsByRunAndStatus ¶
func (*Queries) CountJobsByRunAttemptGroupByStatus ¶
func (q *Queries) CountJobsByRunAttemptGroupByStatus(ctx context.Context, arg CountJobsByRunAttemptGroupByStatusParams) ([]CountJobsByRunAttemptGroupByStatusRow, error)
Counts jobs by status for a specific run attempt. Used by terminal detection to determine runs.status.
func (*Queries) CountJobsForTUI ¶
Counts jobs with optional run_id filter. run_id: if non-null, count jobs for that run; if null, count all jobs. Used with ListJobsForTUI to provide total for TUI pagination.
func (*Queries) CountRunsByWaveStatus ¶
func (*Queries) CountStaleNodesWithRunningJobs ¶
func (q *Queries) CountStaleNodesWithRunningJobs(ctx context.Context, lastHeartbeat pgtype.Timestamptz) (int64, error)
Counts distinct stale nodes that currently have at least one running job. Excludes NULL node_id rows (orphaned running jobs) from node count.
func (*Queries) CreateArtifactBundle ¶
func (q *Queries) CreateArtifactBundle(ctx context.Context, arg CreateArtifactBundleParams) (ArtifactBundle, error)
Creates a new artifact bundle metadata. Blob data is stored in object storage. Bundles are grouped at the job level only (build_id removed).
func (*Queries) CreateDiff ¶
Creates a new diff entry associated with a job. Blob data is stored in object storage.
func (*Queries) CreateEvent ¶
func (*Queries) CreateJob ¶
Note: `id` is a required TEXT parameter (KSUID-backed); caller generates via types.NewJobID().
func (*Queries) CreateLog ¶
Creates a new log chunk metadata. Blob data is stored in object storage. Logs are grouped at the job level only (build_id removed).
func (*Queries) CreateMigRepo ¶
func (*Queries) CreateNamedSpec ¶
func (*Queries) CreateNode ¶
Creates a new node with an application-supplied URL-safe ID as the primary key.
func (*Queries) CreateNodeDaemonLog ¶
func (q *Queries) CreateNodeDaemonLog(ctx context.Context, arg CreateNodeDaemonLogParams) (NodeDaemonLog, error)
func (*Queries) CreateSpec ¶
func (*Queries) CreateSpecBundle ¶
func (q *Queries) CreateSpecBundle(ctx context.Context, arg CreateSpecBundleParams) (SpecBundle, error)
Creates a new spec bundle metadata row. Blob data is stored in object storage.
func (*Queries) CreateWave ¶
func (*Queries) DeleteArtifactBundle ¶
func (*Queries) DeleteArtifactBundlesOlderThan ¶
func (*Queries) DeleteConfigBundleMap ¶
Removes a bundle map entry by hash.
func (*Queries) DeleteConfigIn ¶
func (q *Queries) DeleteConfigIn(ctx context.Context, arg DeleteConfigInParams) error
Removes an in entry by dst and section.
func (*Queries) DeleteConfigInBySection ¶
Removes all in entries for a section.
func (*Queries) DeleteDiff ¶
func (*Queries) DeleteDiffsOlderThan ¶
func (*Queries) DeleteExpiredArtifactBundles ¶
func (q *Queries) DeleteExpiredArtifactBundles(ctx context.Context, createdAt pgtype.Timestamptz) (int64, error)
DeleteExpiredArtifactBundles removes artifact bundle rows older than the specified timestamp.
func (*Queries) DeleteExpiredDiffs ¶
func (q *Queries) DeleteExpiredDiffs(ctx context.Context, createdAt pgtype.Timestamptz) (int64, error)
DeleteExpiredDiffs removes diff rows older than the specified timestamp.
func (*Queries) DeleteExpiredEvents ¶
DeleteExpiredEvents removes event rows older than the specified timestamp.
func (*Queries) DeleteExpiredLogs ¶
func (q *Queries) DeleteExpiredLogs(ctx context.Context, createdAt pgtype.Timestamptz) (int64, error)
DeleteExpiredLogs removes log rows older than the specified timestamp.
func (*Queries) DeleteGlobalEnv ¶
func (q *Queries) DeleteGlobalEnv(ctx context.Context, arg DeleteGlobalEnvParams) error
Removes an environment entry by key and target. No-op if the (key, target) pair does not exist (exec returns no error).
func (*Queries) DeleteLogsOlderThan ¶
func (*Queries) DeleteMig ¶
Deletes a mig. Use with caution; should only be called when safe to remove.
func (*Queries) DeleteMigRepo ¶
Deletes a mig_repo by id. Note: mig_repos.id remains referenced by API-level repo membership records.
func (*Queries) DeleteNode ¶
func (*Queries) DeleteSBOMRowsByJob ¶
func (*Queries) DeleteSpecBundle ¶
Deletes a spec bundle metadata row by ID. Called by blobpersist as rollback when object storage upload fails.
func (*Queries) DeleteWave ¶
func (*Queries) GetAPITokenByID ¶
func (*Queries) GetAdjacentJobIndices ¶
func (q *Queries) GetAdjacentJobIndices(ctx context.Context, id types.JobID) (GetAdjacentJobIndicesRow, error)
Transitional: returns current job id and linked successor id.
func (*Queries) GetArtifactBundle ¶
Returns artifact bundle metadata including object_key for object-storage retrieval.
func (*Queries) GetBootstrapToken ¶
func (*Queries) GetGlobalEnv ¶
Retrieves a single environment entry by key and target. Returns pgx.ErrNoRows if the (key, target) pair does not exist.
func (*Queries) GetLatestDiffByJob ¶
func (*Queries) GetLatestRunByMigAndRepoStatus ¶
func (q *Queries) GetLatestRunByMigAndRepoStatus(ctx context.Context, arg GetLatestRunByMigAndRepoStatusParams) (GetLatestRunByMigAndRepoStatusRow, error)
func (*Queries) GetMigByName ¶
func (*Queries) GetMigRepo ¶
func (*Queries) GetMigRepoByURL ¶
Gets a mig_repo by mig_id and repo_url (for uniqueness constraint enforcement).
func (*Queries) GetNamedSpecByNameSourceSHA ¶
func (*Queries) GetRunSnapshotMetadata ¶
func (*Queries) GetRunTiming ¶
func (*Queries) GetSpecBundle ¶
Returns spec bundle metadata including object_key for object-storage retrieval.
func (*Queries) GetSpecBundleByCID ¶
Returns the most recently created spec bundle for a given cid. Used for deduplication: callers should check by CID before uploading.
func (*Queries) HasMigRepoHistory ¶
Checks if a mig_repo has any historical executions. Returns true if the repo cannot be deleted due to history, false otherwise.
func (*Queries) HasRunningJobForRunNode ¶
func (*Queries) IncrementRunAttempt ¶
func (q *Queries) IncrementRunAttempt(ctx context.Context, arg IncrementRunAttemptParams) error
func (*Queries) InsertAPIToken ¶
func (q *Queries) InsertAPIToken(ctx context.Context, arg InsertAPITokenParams) error
func (*Queries) InsertBootstrapToken ¶
func (q *Queries) InsertBootstrapToken(ctx context.Context, arg InsertBootstrapTokenParams) error
func (*Queries) ListAPITokens ¶
func (q *Queries) ListAPITokens(ctx context.Context) ([]ListAPITokensRow, error)
func (*Queries) ListArtifactBundlePartitions ¶
ListArtifactBundlePartitions retrieves all partition names for the artifact_bundles table.
func (*Queries) ListArtifactBundlesByCID ¶
func (q *Queries) ListArtifactBundlesByCID(ctx context.Context, cid *string) ([]ArtifactBundle, error)
Returns artifact bundle metadata including object_key for object-storage retrieval.
func (*Queries) ListArtifactBundlesByRun ¶
func (q *Queries) ListArtifactBundlesByRun(ctx context.Context, runID types.RunID) ([]ArtifactBundle, error)
Returns artifact bundle metadata including object_key for object-storage retrieval.
func (*Queries) ListArtifactBundlesByRunAndJob ¶
func (q *Queries) ListArtifactBundlesByRunAndJob(ctx context.Context, arg ListArtifactBundlesByRunAndJobParams) ([]ArtifactBundle, error)
Returns artifact bundle metadata including object_key for object-storage retrieval.
func (*Queries) ListConfigBundleMap ¶
func (q *Queries) ListConfigBundleMap(ctx context.Context) ([]ConfigBundleMap, error)
config_bundle_map.sql — CRUD queries for global bundle map entries (config_bundle_map table). Provides ListConfigBundleMap, UpsertConfigBundleMap, DeleteConfigBundleMap. Returns all bundle map entries ordered by hash for deterministic iteration.
func (*Queries) ListConfigIn ¶
config_in.sql — CRUD queries for global in mount entries (config_in table). Provides ListConfigIn, UpsertConfigIn, DeleteConfigIn, DeleteConfigInBySection. Returns all in entries ordered by section then dst for deterministic iteration.
func (*Queries) ListConfigInBySection ¶
Returns in entries for a specific section ordered by dst.
func (*Queries) ListCreatedJobsByRunAttempt ¶
func (*Queries) ListDiffsByRun ¶
Returns diff metadata for a run.
func (*Queries) ListDistinctRepos ¶
func (q *Queries) ListDistinctRepos(ctx context.Context, filter string) ([]ListDistinctReposRow, error)
Lists distinct repos for a mig with last known run metadata, optionally filtered by repo_url substring.
func (*Queries) ListEventPartitions ¶
ListEventPartitions retrieves all partition names for the events table.
func (*Queries) ListEventsByRun ¶
func (*Queries) ListEventsByRunSince ¶
func (*Queries) ListFailedRepoIDsByMig ¶
func (*Queries) ListGlobalEnv ¶
config_env.sql — CRUD queries for global environment variables (config_env table). Provides ListGlobalEnv, GetGlobalEnv, UpsertGlobalEnv, DeleteGlobalEnv. Returns all global environment entries, ordered by key then target for consistent iteration. Used by ConfigHolder initialization and HTTP list endpoint.
func (*Queries) ListJobsByRun ¶
func (*Queries) ListJobsByRunAttempt ¶
func (*Queries) ListJobsForTUI ¶
func (q *Queries) ListJobsForTUI(ctx context.Context, arg ListJobsForTUIParams) ([]ListJobsForTUIRow, error)
Lists jobs with optional run_id filter, ordered newest-to-oldest by job id. run_id: if non-null, filter to jobs for that run; if null, return all jobs. Joins runs and migs to surface mig_name per job for the TUI jobs-list screen.
func (*Queries) ListLatestNamedSpecs ¶
func (q *Queries) ListLatestNamedSpecs(ctx context.Context, arg ListLatestNamedSpecsParams) ([]ListLatestNamedSpecsRow, error)
func (*Queries) ListLogPartitions ¶
ListLogPartitions retrieves all partition names for the logs table.
func (*Queries) ListLogsByRun ¶
Returns log metadata including object_key for object-storage retrieval.
func (*Queries) ListLogsByRunAndJob ¶
func (q *Queries) ListLogsByRunAndJob(ctx context.Context, arg ListLogsByRunAndJobParams) ([]Log, error)
Returns log metadata including object_key for object-storage retrieval.
func (*Queries) ListLogsByRunAndJobSince ¶
func (q *Queries) ListLogsByRunAndJobSince(ctx context.Context, arg ListLogsByRunAndJobSinceParams) ([]Log, error)
Returns log metadata including object_key for object-storage retrieval.
func (*Queries) ListLogsByRunSince ¶
func (q *Queries) ListLogsByRunSince(ctx context.Context, arg ListLogsByRunSinceParams) ([]Log, error)
Returns log metadata including object_key for object-storage retrieval.
func (*Queries) ListMigReposByMig ¶
func (*Queries) ListMigs ¶
Lists migs with optional filtering by archived status and name substring. archived_only: if true, return only archived migs; if false, return only active migs; if null, return all. name_filter: if non-empty, filter by name substring (case-insensitive); if null/empty, no name filtering.
func (*Queries) ListNodeDaemonLogs ¶
func (q *Queries) ListNodeDaemonLogs(ctx context.Context, arg ListNodeDaemonLogsParams) ([]NodeDaemonLog, error)
func (*Queries) ListNodeDiagnostics ¶
func (*Queries) ListNodeMetricsPartitions ¶
ListNodeMetricsPartitions retrieves all partition names for the node_metrics table.
func (*Queries) ListQueuedRunsByWave ¶
func (*Queries) ListRunSBOMRowsByJobType ¶
func (q *Queries) ListRunSBOMRowsByJobType(ctx context.Context, arg ListRunSBOMRowsByJobTypeParams) ([]ListRunSBOMRowsByJobTypeRow, error)
func (*Queries) ListRunsByWave ¶
func (*Queries) ListRunsForRepo ¶
func (q *Queries) ListRunsForRepo(ctx context.Context, arg ListRunsForRepoParams) ([]ListRunsForRepoRow, error)
func (*Queries) ListRunsTimings ¶
func (q *Queries) ListRunsTimings(ctx context.Context, arg ListRunsTimingsParams) ([]RunsTiming, error)
func (*Queries) ListRunsWithMetadata ¶
func (q *Queries) ListRunsWithMetadata(ctx context.Context, arg ListRunsWithMetadataParams) ([]ListRunsWithMetadataRow, error)
func (*Queries) ListRunsWithURLByWave ¶
func (*Queries) ListSpecBundles ¶
func (q *Queries) ListSpecBundles(ctx context.Context, arg ListSpecBundlesParams) ([]SpecBundle, error)
Lists spec bundles ordered by created_at descending (most recent first).
func (*Queries) ListSpecBundlesUnreferencedBefore ¶
func (q *Queries) ListSpecBundlesUnreferencedBefore(ctx context.Context, lastRefAt pgtype.Timestamptz) ([]SpecBundle, error)
Lists spec bundles whose last_ref_at is before the given threshold. Used by GC to find bundles eligible for deletion.
func (*Queries) ListSpecs ¶
Lists specs ordered by created_at descending (most recent first). There is an index on created_at to optimize this query.
func (*Queries) ListStaleRunningJobs ¶
func (q *Queries) ListStaleRunningJobs(ctx context.Context, lastHeartbeat pgtype.Timestamptz) ([]ListStaleRunningJobsRow, error)
Lists running jobs whose assigned node is stale at the provided cutoff. Rows are grouped by (run_id, attempt) for deterministic recovery processing.
func (*Queries) ListWavesByMig ¶
func (*Queries) ListWavesWithQueuedRuns ¶
func (*Queries) MarkBootstrapTokenCertIssued ¶
func (*Queries) PromoteJobByIDIfUnblocked ¶
Atomically promote a specific linked successor job: Created -> Queued. The candidate is eligible only when every predecessor that points to it is Success.
func (*Queries) ResolveLatestNamedSpecByDomainRepoName ¶
func (q *Queries) ResolveLatestNamedSpecByDomainRepoName(ctx context.Context, arg ResolveLatestNamedSpecByDomainRepoNameParams) ([]ResolveLatestNamedSpecByDomainRepoNameRow, error)
func (*Queries) ResolveLatestNamedSpecByName ¶
func (q *Queries) ResolveLatestNamedSpecByName(ctx context.Context, arg ResolveLatestNamedSpecByNameParams) ([]ResolveLatestNamedSpecByNameRow, error)
func (*Queries) ResolveLatestNamedSpecByRepoName ¶
func (q *Queries) ResolveLatestNamedSpecByRepoName(ctx context.Context, arg ResolveLatestNamedSpecByRepoNameParams) ([]ResolveLatestNamedSpecByRepoNameRow, error)
func (*Queries) ResolveNamedSpecVersionByDomainRepoName ¶
func (*Queries) ResolveNamedSpecVersionByName ¶
func (*Queries) ResolveNamedSpecVersionByRepoName ¶
func (*Queries) RevokeAPIToken ¶
func (*Queries) ScheduleNextJob ¶
Atomically promote the next unblocked job in a run attempt: Created -> Queued. A created job is unblocked when all predecessor jobs that point to it are Success.
func (*Queries) TrimNodeDaemonLogs ¶
func (q *Queries) TrimNodeDaemonLogs(ctx context.Context, arg TrimNodeDaemonLogsParams) error
func (*Queries) UnarchiveMig ¶
Unarchives a mig by clearing archived_at.
func (*Queries) UnclaimJob ¶
func (q *Queries) UnclaimJob(ctx context.Context, arg UnclaimJobParams) error
Revert a claimed Running job back to claimable Queued state. Guarded by both job id and node id so a foreign node cannot steal the slot.
func (*Queries) UpdateAPITokenLastUsed ¶
func (*Queries) UpdateBootstrapTokenLastUsed ¶
func (*Queries) UpdateJobCompletion ¶
func (q *Queries) UpdateJobCompletion(ctx context.Context, arg UpdateJobCompletionParams) error
func (*Queries) UpdateJobCompletionWithMeta ¶
func (q *Queries) UpdateJobCompletionWithMeta(ctx context.Context, arg UpdateJobCompletionWithMetaParams) error
func (*Queries) UpdateJobImageName ¶
func (q *Queries) UpdateJobImageName(ctx context.Context, arg UpdateJobImageNameParams) error
Persist the container image name used to execute a job. This is set by the node immediately before job execution starts.
func (*Queries) UpdateJobMeta ¶
func (q *Queries) UpdateJobMeta(ctx context.Context, arg UpdateJobMetaParams) error
func (*Queries) UpdateJobNextID ¶
func (q *Queries) UpdateJobNextID(ctx context.Context, arg UpdateJobNextIDParams) error
func (*Queries) UpdateJobRepoSHAIn ¶
func (q *Queries) UpdateJobRepoSHAIn(ctx context.Context, arg UpdateJobRepoSHAInParams) error
func (*Queries) UpdateJobStatus ¶
func (q *Queries) UpdateJobStatus(ctx context.Context, arg UpdateJobStatusParams) error
func (*Queries) UpdateMigRepoBaseRef ¶
func (q *Queries) UpdateMigRepoBaseRef(ctx context.Context, arg UpdateMigRepoBaseRefParams) error
func (*Queries) UpdateMigSpec ¶
func (q *Queries) UpdateMigSpec(ctx context.Context, arg UpdateMigSpecParams) error
func (*Queries) UpdateNamedSpecArchiveState ¶
func (*Queries) UpdateNodeCertMetadata ¶
func (q *Queries) UpdateNodeCertMetadata(ctx context.Context, arg UpdateNodeCertMetadataParams) error
func (*Queries) UpdateNodeDrained ¶
func (q *Queries) UpdateNodeDrained(ctx context.Context, arg UpdateNodeDrainedParams) error
func (*Queries) UpdateNodeHeartbeat ¶
func (q *Queries) UpdateNodeHeartbeat(ctx context.Context, arg UpdateNodeHeartbeatParams) error
func (*Queries) UpdateRunBaseRef ¶
func (q *Queries) UpdateRunBaseRef(ctx context.Context, arg UpdateRunBaseRefParams) error
func (*Queries) UpdateRunError ¶
func (q *Queries) UpdateRunError(ctx context.Context, arg UpdateRunErrorParams) error
func (*Queries) UpdateRunResume ¶
func (*Queries) UpdateRunStatus ¶
func (q *Queries) UpdateRunStatus(ctx context.Context, arg UpdateRunStatusParams) error
func (*Queries) UpdateSpecBundleLastRefAt ¶
Updates last_ref_at to now() for the given spec bundle. Call this whenever a spec or run references the bundle to keep GC metadata fresh.
func (*Queries) UpdateWaveCompletion ¶
func (q *Queries) UpdateWaveCompletion(ctx context.Context, arg UpdateWaveCompletionParams) error
func (*Queries) UpdateWaveStatus ¶
func (q *Queries) UpdateWaveStatus(ctx context.Context, arg UpdateWaveStatusParams) error
func (*Queries) UpsertConfigBundleMap ¶
func (q *Queries) UpsertConfigBundleMap(ctx context.Context, arg UpsertConfigBundleMapParams) error
Inserts or updates a bundle map entry (upsert on primary key hash). Refreshes bundle_id and updated_at on conflict.
func (*Queries) UpsertConfigIn ¶
func (q *Queries) UpsertConfigIn(ctx context.Context, arg UpsertConfigInParams) error
Inserts or updates an in entry (upsert on composite key (dst, section)). Refreshes entry and updated_at on conflict (entry may change if hash changes).
func (*Queries) UpsertGlobalEnv ¶
func (q *Queries) UpsertGlobalEnv(ctx context.Context, arg UpsertGlobalEnvParams) error
Inserts or updates an environment entry (upsert on composite key (key, target)). Updates value, secret, and refreshes updated_at on conflict. This ensures idempotent set operations from the CLI or API.
func (*Queries) UpsertJobMetric ¶
func (q *Queries) UpsertJobMetric(ctx context.Context, arg UpsertJobMetricParams) error
func (*Queries) UpsertMigRepo ¶
Bulk upsert a mig_repo by normalized repo_url. Uniqueness is on (mig_id, repo_id) to prevent duplicate repo membership per mig.
func (*Queries) UpsertNodeDiagnostic ¶
func (q *Queries) UpsertNodeDiagnostic(ctx context.Context, arg UpsertNodeDiagnosticParams) (NodeDiagnostic, error)
func (*Queries) UpsertSBOMRow ¶
func (q *Queries) UpsertSBOMRow(ctx context.Context, arg UpsertSBOMRowParams) error
type Repo ¶
type Repo struct {
ID types.RepoID `json:"id"`
Url string `json:"url"`
CreatedAt pgtype.Timestamptz `json:"created_at"`
}
type ResolveLatestNamedSpecByDomainRepoNameRow ¶
type ResolveLatestNamedSpecByDomainRepoNameRow struct {
ID string `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
Source []byte `json:"source"`
Sha string `json:"sha"`
SourceCommittedAt pgtype.Timestamptz `json:"source_committed_at"`
Spec []byte `json:"spec"`
CreatedBy *string `json:"created_by"`
UpdatedBy *string `json:"updated_by"`
CreatedAt pgtype.Timestamptz `json:"created_at"`
ArchivedAt pgtype.Timestamptz `json:"archived_at"`
}
type ResolveLatestNamedSpecByNameRow ¶
type ResolveLatestNamedSpecByNameRow struct {
ID string `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
Source []byte `json:"source"`
Sha string `json:"sha"`
SourceCommittedAt pgtype.Timestamptz `json:"source_committed_at"`
Spec []byte `json:"spec"`
CreatedBy *string `json:"created_by"`
UpdatedBy *string `json:"updated_by"`
CreatedAt pgtype.Timestamptz `json:"created_at"`
ArchivedAt pgtype.Timestamptz `json:"archived_at"`
}
type ResolveLatestNamedSpecByRepoNameRow ¶
type ResolveLatestNamedSpecByRepoNameRow struct {
ID string `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
Source []byte `json:"source"`
Sha string `json:"sha"`
SourceCommittedAt pgtype.Timestamptz `json:"source_committed_at"`
Spec []byte `json:"spec"`
CreatedBy *string `json:"created_by"`
UpdatedBy *string `json:"updated_by"`
CreatedAt pgtype.Timestamptz `json:"created_at"`
ArchivedAt pgtype.Timestamptz `json:"archived_at"`
}
type RestartRunParams ¶ added in v0.1.16
type Run ¶
type Run struct {
ID types.RunID `json:"id"`
WaveID types.WaveID `json:"wave_id"`
MigID types.MigID `json:"mig_id"`
SpecID types.SpecID `json:"spec_id"`
RepoID types.RepoID `json:"repo_id"`
RepoBaseRef string `json:"repo_base_ref"`
SourceCommitSha string `json:"source_commit_sha"`
RepoSha0 string `json:"repo_sha0"`
CreatedBy *string `json:"created_by"`
Status types.RunStatus `json:"status"`
Attempt int32 `json:"attempt"`
LastError *string `json:"last_error"`
CreatedAt pgtype.Timestamptz `json:"created_at"`
StartedAt pgtype.Timestamptz `json:"started_at"`
FinishedAt pgtype.Timestamptz `json:"finished_at"`
Stats []byte `json:"stats"`
}
type RunsTiming ¶
type ScheduleNextJobParams ¶
type Spec ¶
type Spec struct {
ID types.SpecID `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
Source []byte `json:"source"`
Sha string `json:"sha"`
SourceCommittedAt pgtype.Timestamptz `json:"source_committed_at"`
Spec []byte `json:"spec"`
CreatedBy *string `json:"created_by"`
UpdatedBy *string `json:"updated_by"`
CreatedAt pgtype.Timestamptz `json:"created_at"`
ArchivedAt pgtype.Timestamptz `json:"archived_at"`
}
type SpecBundle ¶
type SpecBundle struct {
ID string `json:"id"`
Cid string `json:"cid"`
Digest string `json:"digest"`
Size int64 `json:"size"`
ObjectKey *string `json:"object_key"`
CreatedBy *string `json:"created_by"`
CreatedAt pgtype.Timestamptz `json:"created_at"`
LastRefAt pgtype.Timestamptz `json:"last_ref_at"`
}
type Store ¶
type Store interface {
Querier
CancelRun(ctx context.Context, runID types.RunID) error
CancelWave(ctx context.Context, waveID types.WaveID) error
CompleteBootstrapEnrollment(ctx context.Context, arg CompleteBootstrapEnrollmentParams) error
CreateWaveWithRuns(ctx context.Context, arg CreateWaveWithRunsParams) (Wave, []Run, error)
RestartRun(ctx context.Context, arg RestartRunParams) (Run, error)
Close()
Pool() *pgxpool.Pool
}
Store defines the interface for database operations. The sqlc-generated Queries type implements the query methods via Querier.
type UnclaimJobParams ¶
type UpdateJobMetaParams ¶
type UpdateJobNextIDParams ¶
type UpdateJobStatusParams ¶
type UpdateJobStatusParams struct {
ID types.JobID `json:"id"`
Status types.JobStatus `json:"status"`
StartedAt pgtype.Timestamptz `json:"started_at"`
FinishedAt pgtype.Timestamptz `json:"finished_at"`
DurationMs int64 `json:"duration_ms"`
}
type UpdateMigSpecParams ¶
type UpdateNodeCertMetadataParams ¶
type UpdateNodeCertMetadataParams struct {
ID types.NodeID `json:"id"`
CertSerial *string `json:"cert_serial"`
CertFingerprint *string `json:"cert_fingerprint"`
CertNotBefore pgtype.Timestamptz `json:"cert_not_before"`
CertNotAfter pgtype.Timestamptz `json:"cert_not_after"`
}
type UpdateNodeDrainedParams ¶
type UpdateNodeHeartbeatParams ¶
type UpdateNodeHeartbeatParams struct {
ID types.NodeID `json:"id"`
LastHeartbeat pgtype.Timestamptz `json:"last_heartbeat"`
CpuTotalMillis int32 `json:"cpu_total_millis"`
CpuFreeMillis int32 `json:"cpu_free_millis"`
MemTotalBytes int64 `json:"mem_total_bytes"`
MemFreeBytes int64 `json:"mem_free_bytes"`
DiskTotalBytes int64 `json:"disk_total_bytes"`
DiskFreeBytes int64 `json:"disk_free_bytes"`
Version string `json:"version"`
}
type UpdateRunBaseRefParams ¶
type UpdateRunErrorParams ¶
type UpdateRunStatusParams ¶
type UpdateWaveCompletionParams ¶
type UpdateWaveCompletionParams struct {
ID types.WaveID `json:"id"`
Status types.WaveStatus `json:"status"`
Stats []byte `json:"stats"`
}
type UpdateWaveStatusParams ¶
type UpdateWaveStatusParams struct {
ID types.WaveID `json:"id"`
Status types.WaveStatus `json:"status"`
}
type UpsertConfigInParams ¶
type UpsertGlobalEnvParams ¶
type UpsertJobMetricParams ¶
type UpsertMigRepoParams ¶
type UpsertNodeDiagnosticParams ¶
type UpsertNodeDiagnosticParams struct {
NodeID types.NodeID `json:"node_id"`
Component string `json:"component"`
Status string `json:"status"`
LastError *string `json:"last_error"`
Version *string `json:"version"`
ImageRef *string `json:"image_ref"`
LocalImageID *string `json:"local_image_id"`
RemoteImageID *string `json:"remote_image_id"`
Details []byte `json:"details"`
LastCheckedAt pgtype.Timestamptz `json:"last_checked_at"`
LastSuccessAt pgtype.Timestamptz `json:"last_success_at"`
}
type UpsertSBOMRowParams ¶
type Wave ¶
type Wave struct {
ID types.WaveID `json:"id"`
MigID types.MigID `json:"mig_id"`
SpecID types.SpecID `json:"spec_id"`
CreatedBy *string `json:"created_by"`
Status types.WaveStatus `json:"status"`
CreatedAt pgtype.Timestamptz `json:"created_at"`
StartedAt pgtype.Timestamptz `json:"started_at"`
FinishedAt pgtype.Timestamptz `json:"finished_at"`
Stats []byte `json:"stats"`
}
Source Files
¶
- artifact_bundles.sql.go
- cluster.sql.go
- config_bundle_map.sql.go
- config_env.sql.go
- config_in.sql.go
- db.go
- diffs.sql.go
- events.sql.go
- job_metrics.sql.go
- jobs.sql.go
- logs.sql.go
- mig_repos.sql.go
- migrations.go
- migs.sql.go
- models.go
- node_diagnostics.sql.go
- nodes.sql.go
- querier.go
- repos.sql.go
- runs.sql.go
- sboms.sql.go
- schema_snapshot.go
- spec_bundles.sql.go
- specs.sql.go
- store.go
- tokens.sql.go
- ttl.sql.go
- uuid.go
- waves.sql.go
Directories
¶
| Path | Synopsis |
|---|---|
|
Package ttlworker provides a background worker for purging expired data from the database.
|
Package ttlworker provides a background worker for purging expired data from the database. |
|
Package wavescheduler provides a background worker for scheduling queued runs within waves.
|
Package wavescheduler provides a background worker for scheduling queued runs within waves. |