Documentation
¶
Index ¶
- type ColumnExistsParams
- type DBTX
- type IndexExistsParams
- type IndexReindexArtifactsParams
- type IndexesExistParams
- type IndexesExistRow
- type JobCancelParams
- type JobCountByAllStatesRow
- type JobCountByQueueAndStateRow
- type JobDeleteBeforeParams
- type JobGetAvailableParams
- type JobGetStuckParams
- type JobInsertFastManyNoReturningParams
- type JobInsertFastManyParams
- type JobInsertFastManyRow
- type JobInsertFullManyParams
- type JobInsertFullParams
- type JobKindListParams
- type JobRescueManyParams
- type JobRetryParams
- type JobScheduleParams
- type JobScheduleRow
- type JobSetStateIfRunningManyParams
- type JobUpdateFullParams
- type JobUpdateParams
- type LeaderAttemptElectParams
- type LeaderAttemptReelectParams
- type LeaderInsertParams
- type LeaderResignParams
- type NotificationDeleteBeforeParams
- type NullRiverJobState
- type PGGetProductAndVersionRow
- type PGNotifyManyParams
- type Queries
- func (q *Queries) ColumnExists(ctx context.Context, db DBTX, arg *ColumnExistsParams) (bool, error)
- func (q *Queries) IndexExists(ctx context.Context, db DBTX, arg *IndexExistsParams) (bool, error)
- func (q *Queries) IndexReindexArtifacts(ctx context.Context, db DBTX, arg *IndexReindexArtifactsParams) ([]string, error)
- func (q *Queries) IndexesExist(ctx context.Context, db DBTX, arg *IndexesExistParams) ([]*IndexesExistRow, error)
- func (q *Queries) JobCancel(ctx context.Context, db DBTX, arg *JobCancelParams) (*RiverJob, error)
- func (q *Queries) JobCountByAllStates(ctx context.Context, db DBTX) ([]*JobCountByAllStatesRow, error)
- func (q *Queries) JobCountByQueueAndState(ctx context.Context, db DBTX, queueNames []string) ([]*JobCountByQueueAndStateRow, error)
- func (q *Queries) JobCountByState(ctx context.Context, db DBTX, state RiverJobState) (int64, error)
- func (q *Queries) JobDelete(ctx context.Context, db DBTX, id int64) (*RiverJob, error)
- func (q *Queries) JobDeleteBefore(ctx context.Context, db DBTX, arg *JobDeleteBeforeParams) (sql.Result, error)
- func (q *Queries) JobDeleteMany(ctx context.Context, db DBTX, max int32) ([]*RiverJob, error)
- func (q *Queries) JobGetAvailable(ctx context.Context, db DBTX, arg *JobGetAvailableParams) ([]*RiverJob, error)
- func (q *Queries) JobGetByID(ctx context.Context, db DBTX, id int64) (*RiverJob, error)
- func (q *Queries) JobGetByIDMany(ctx context.Context, db DBTX, id []int64) ([]*RiverJob, error)
- func (q *Queries) JobGetByKindMany(ctx context.Context, db DBTX, kind []string) ([]*RiverJob, error)
- func (q *Queries) JobGetCancelRequested(ctx context.Context, db DBTX, id []int64) ([]int64, error)
- func (q *Queries) JobGetStuck(ctx context.Context, db DBTX, arg *JobGetStuckParams) ([]*RiverJob, error)
- func (q *Queries) JobInsertFastMany(ctx context.Context, db DBTX, arg *JobInsertFastManyParams) ([]*JobInsertFastManyRow, error)
- func (q *Queries) JobInsertFastManyNoReturning(ctx context.Context, db DBTX, arg *JobInsertFastManyNoReturningParams) (int64, error)
- func (q *Queries) JobInsertFull(ctx context.Context, db DBTX, arg *JobInsertFullParams) (*RiverJob, error)
- func (q *Queries) JobInsertFullMany(ctx context.Context, db DBTX, arg *JobInsertFullManyParams) ([]*RiverJob, error)
- func (q *Queries) JobKindList(ctx context.Context, db DBTX, arg *JobKindListParams) ([]string, error)
- func (q *Queries) JobList(ctx context.Context, db DBTX, max int32) ([]*RiverJob, error)
- func (q *Queries) JobRescueMany(ctx context.Context, db DBTX, arg *JobRescueManyParams) error
- func (q *Queries) JobRetry(ctx context.Context, db DBTX, arg *JobRetryParams) (*RiverJob, error)
- func (q *Queries) JobSchedule(ctx context.Context, db DBTX, arg *JobScheduleParams) ([]*JobScheduleRow, error)
- func (q *Queries) JobSetStateIfRunningMany(ctx context.Context, db DBTX, arg *JobSetStateIfRunningManyParams) ([]*RiverJob, error)
- func (q *Queries) JobUpdate(ctx context.Context, db DBTX, arg *JobUpdateParams) (*RiverJob, error)
- func (q *Queries) JobUpdateFull(ctx context.Context, db DBTX, arg *JobUpdateFullParams) (*RiverJob, error)
- func (q *Queries) LeaderAttemptElect(ctx context.Context, db DBTX, arg *LeaderAttemptElectParams) (*RiverLeader, error)
- func (q *Queries) LeaderAttemptReelect(ctx context.Context, db DBTX, arg *LeaderAttemptReelectParams) (*RiverLeader, error)
- func (q *Queries) LeaderDeleteExpired(ctx context.Context, db DBTX, now *time.Time) (int64, error)
- func (q *Queries) LeaderGetElectedLeader(ctx context.Context, db DBTX) (*RiverLeader, error)
- func (q *Queries) LeaderInsert(ctx context.Context, db DBTX, arg *LeaderInsertParams) (*RiverLeader, error)
- func (q *Queries) LeaderResign(ctx context.Context, db DBTX, arg *LeaderResignParams) (int64, error)
- func (q *Queries) NotificationDeleteBefore(ctx context.Context, db DBTX, arg *NotificationDeleteBeforeParams) (int64, error)
- func (q *Queries) PGAdvisoryXactLock(ctx context.Context, db DBTX, key int64) error
- func (q *Queries) PGGetProductAndVersion(ctx context.Context, db DBTX) (*PGGetProductAndVersionRow, error)
- func (q *Queries) PGNotifyMany(ctx context.Context, db DBTX, arg *PGNotifyManyParams) error
- func (q *Queries) QueueCreateOrSetUpdatedAt(ctx context.Context, db DBTX, arg *QueueCreateOrSetUpdatedAtParams) (*RiverQueue, error)
- func (q *Queries) QueueDeleteExpired(ctx context.Context, db DBTX, arg *QueueDeleteExpiredParams) ([]*RiverQueue, error)
- func (q *Queries) QueueGet(ctx context.Context, db DBTX, name string) (*RiverQueue, error)
- func (q *Queries) QueueList(ctx context.Context, db DBTX, max int32) ([]*RiverQueue, error)
- func (q *Queries) QueueNameList(ctx context.Context, db DBTX, arg *QueueNameListParams) ([]string, error)
- func (q *Queries) QueuePause(ctx context.Context, db DBTX, arg *QueuePauseParams) (int64, error)
- func (q *Queries) QueueResume(ctx context.Context, db DBTX, arg *QueueResumeParams) (int64, error)
- func (q *Queries) QueueUpdate(ctx context.Context, db DBTX, arg *QueueUpdateParams) (*RiverQueue, error)
- func (q *Queries) RiverMigrationDeleteAssumingMainMany(ctx context.Context, db DBTX, version []int64) ([]*RiverMigrationDeleteAssumingMainManyRow, error)
- func (q *Queries) RiverMigrationDeleteByLineAndVersionMany(ctx context.Context, db DBTX, ...) ([]*RiverMigration, error)
- func (q *Queries) RiverMigrationGetAllAssumingMain(ctx context.Context, db DBTX) ([]*RiverMigrationGetAllAssumingMainRow, error)
- func (q *Queries) RiverMigrationGetByLine(ctx context.Context, db DBTX, line string) ([]*RiverMigration, error)
- func (q *Queries) RiverMigrationInsert(ctx context.Context, db DBTX, arg *RiverMigrationInsertParams) (*RiverMigration, error)
- func (q *Queries) RiverMigrationInsertMany(ctx context.Context, db DBTX, arg *RiverMigrationInsertManyParams) ([]*RiverMigration, error)
- func (q *Queries) RiverMigrationInsertManyAssumingMain(ctx context.Context, db DBTX, version []int64) ([]*RiverMigrationInsertManyAssumingMainRow, error)
- func (q *Queries) RiverMigrationLock(ctx context.Context, db DBTX, arg *RiverMigrationLockParams) error
- func (q *Queries) RiverMigrationLockRefreshCatalog(ctx context.Context, db DBTX) error
- func (q *Queries) SchemaGetExpired(ctx context.Context, db DBTX, arg *SchemaGetExpiredParams) ([]string, error)
- func (q *Queries) TableExists(ctx context.Context, db DBTX, schemaAndTable string) (bool, error)
- type QueueCreateOrSetUpdatedAtParams
- type QueueDeleteExpiredParams
- type QueueNameListParams
- type QueuePauseParams
- type QueueResumeParams
- type QueueUpdateParams
- type RiverJob
- type RiverJobState
- type RiverLeader
- type RiverMigration
- type RiverMigrationDeleteAssumingMainManyRow
- type RiverMigrationDeleteByLineAndVersionManyParams
- type RiverMigrationGetAllAssumingMainRow
- type RiverMigrationInsertManyAssumingMainRow
- type RiverMigrationInsertManyParams
- type RiverMigrationInsertParams
- type RiverMigrationLockParams
- type RiverNotification
- type RiverQueue
- type SchemaGetExpiredParams
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ColumnExistsParams ¶
type IndexExistsParams ¶
type IndexExistsParams struct {
Index string
Schema sql.NullString
}
type IndexReindexArtifactsParams ¶
type IndexReindexArtifactsParams struct {
Index string
Schema sql.NullString
}
type IndexesExistParams ¶
type IndexesExistParams struct {
Schema sql.NullString
IndexNames []string
}
type IndexesExistRow ¶
type JobCancelParams ¶
type JobCountByAllStatesRow ¶
type JobCountByAllStatesRow struct {
State RiverJobState
Count int64
}
type JobDeleteBeforeParams ¶
type JobGetAvailableParams ¶
type JobGetStuckParams ¶
type JobInsertFastManyParams ¶
type JobInsertFastManyRow ¶
type JobInsertFullManyParams ¶
type JobInsertFullManyParams struct {
Args []string
Attempt []int16
AttemptedAt []time.Time
CreatedAt []time.Time
FinalizedAt []time.Time
Kind []string
MaxAttempts []int16
Metadata []string
Priority []int16
Queue []string
ScheduledAt []time.Time
State []string
Tags []string
UniqueKey []string
UniqueStates []int32
}
type JobInsertFullParams ¶
type JobInsertFullParams struct {
Args string
Attempt int16
AttemptedAt *time.Time
AttemptedBy []string
CreatedAt *time.Time
Errors []string
FinalizedAt *time.Time
Kind string
MaxAttempts int16
Metadata string
Priority int16
Queue string
ScheduledAt *time.Time
State RiverJobState
Tags []string
UniqueKey string
UniqueStates int32
}
type JobKindListParams ¶
type JobRescueManyParams ¶
type JobRetryParams ¶
type JobScheduleParams ¶
type JobScheduleRow ¶
type JobSetStateIfRunningManyParams ¶
type JobSetStateIfRunningManyParams struct {
IDs []int64
AttemptDoUpdate []bool
Attempt []int32
ErrorsDoUpdate []bool
Errors []string
FinalizedAtDoUpdate []bool
FinalizedAt []time.Time
MetadataDoMerge []bool
MetadataUpdates []string
ScheduledAtDoUpdate []bool
ScheduledAt []time.Time
State []string
Now *time.Time
}
type JobUpdateFullParams ¶
type JobUpdateFullParams struct {
AttemptDoUpdate bool
Attempt int16
AttemptedAtDoUpdate bool
AttemptedAt *time.Time
AttemptedByDoUpdate bool
AttemptedBy []string
ErrorsDoUpdate bool
Errors []string
FinalizedAtDoUpdate bool
FinalizedAt *time.Time
MaxAttemptsDoUpdate bool
MaxAttempts int16
MetadataDoUpdate bool
Metadata string
StateDoUpdate bool
State RiverJobState
ID int64
}
type JobUpdateParams ¶
type LeaderInsertParams ¶
type LeaderResignParams ¶
type NullRiverJobState ¶
type NullRiverJobState struct {
RiverJobState RiverJobState
Valid bool // Valid is true if RiverJobState is not NULL
}
func (*NullRiverJobState) Scan ¶
func (ns *NullRiverJobState) Scan(value interface{}) error
Scan implements the Scanner interface.
type PGNotifyManyParams ¶
type PGNotifyManyParams struct {
Schema sql.NullString
Topic string
Payload []string
}
type Queries ¶
type Queries struct {
}
func (*Queries) ColumnExists ¶
Resolves the table the same way as TableExists (`to_regclass`, which falls back to `search_path` when the name is unqualified) so that the two agree on which table is being inspected.
func (*Queries) IndexExists ¶
func (*Queries) IndexReindexArtifacts ¶
func (*Queries) IndexesExist ¶
func (q *Queries) IndexesExist(ctx context.Context, db DBTX, arg *IndexesExistParams) ([]*IndexesExistRow, error)
func (*Queries) JobCountByAllStates ¶
func (*Queries) JobCountByQueueAndState ¶
func (*Queries) JobCountByState ¶
func (*Queries) JobDeleteBefore ¶
func (*Queries) JobDeleteMany ¶
this last SELECT step is necessary because there's no other way to define order records come back from a DELETE statement
func (*Queries) JobGetAvailable ¶
func (*Queries) JobGetByID ¶
func (*Queries) JobGetByIDMany ¶
func (*Queries) JobGetByKindMany ¶
func (*Queries) JobGetCancelRequested ¶
func (*Queries) JobGetStuck ¶
func (*Queries) JobInsertFastMany ¶
func (q *Queries) JobInsertFastMany(ctx context.Context, db DBTX, arg *JobInsertFastManyParams) ([]*JobInsertFastManyRow, error)
func (*Queries) JobInsertFastManyNoReturning ¶
func (*Queries) JobInsertFull ¶
func (*Queries) JobInsertFullMany ¶
func (*Queries) JobKindList ¶
func (*Queries) JobRescueMany ¶
Run by the rescuer to queue for retry or discard depending on job state.
func (*Queries) JobSchedule ¶
func (q *Queries) JobSchedule(ctx context.Context, db DBTX, arg *JobScheduleParams) ([]*JobScheduleRow, error)
func (*Queries) JobSetStateIfRunningMany ¶
func (*Queries) JobUpdateFull ¶
func (q *Queries) JobUpdateFull(ctx context.Context, db DBTX, arg *JobUpdateFullParams) (*RiverJob, error)
A generalized update for any property on a job. This brings in a large number of parameters and therefore may be more suitable for testing than production.
func (*Queries) LeaderAttemptElect ¶
func (q *Queries) LeaderAttemptElect(ctx context.Context, db DBTX, arg *LeaderAttemptElectParams) (*RiverLeader, error)
func (*Queries) LeaderAttemptReelect ¶
func (q *Queries) LeaderAttemptReelect(ctx context.Context, db DBTX, arg *LeaderAttemptReelectParams) (*RiverLeader, error)
func (*Queries) LeaderDeleteExpired ¶
func (*Queries) LeaderGetElectedLeader ¶
func (*Queries) LeaderInsert ¶
func (q *Queries) LeaderInsert(ctx context.Context, db DBTX, arg *LeaderInsertParams) (*RiverLeader, error)
func (*Queries) LeaderResign ¶
func (*Queries) NotificationDeleteBefore ¶
func (*Queries) PGAdvisoryXactLock ¶
func (*Queries) PGGetProductAndVersion ¶
func (*Queries) PGNotifyMany ¶
func (*Queries) QueueCreateOrSetUpdatedAt ¶
func (q *Queries) QueueCreateOrSetUpdatedAt(ctx context.Context, db DBTX, arg *QueueCreateOrSetUpdatedAtParams) (*RiverQueue, error)
func (*Queries) QueueDeleteExpired ¶
func (q *Queries) QueueDeleteExpired(ctx context.Context, db DBTX, arg *QueueDeleteExpiredParams) ([]*RiverQueue, error)
func (*Queries) QueueNameList ¶
func (*Queries) QueuePause ¶
func (*Queries) QueueResume ¶
func (*Queries) QueueUpdate ¶
func (q *Queries) QueueUpdate(ctx context.Context, db DBTX, arg *QueueUpdateParams) (*RiverQueue, error)
func (*Queries) RiverMigrationDeleteAssumingMainMany ¶
func (*Queries) RiverMigrationDeleteByLineAndVersionMany ¶
func (q *Queries) RiverMigrationDeleteByLineAndVersionMany(ctx context.Context, db DBTX, arg *RiverMigrationDeleteByLineAndVersionManyParams) ([]*RiverMigration, error)
func (*Queries) RiverMigrationGetAllAssumingMain ¶
func (q *Queries) RiverMigrationGetAllAssumingMain(ctx context.Context, db DBTX) ([]*RiverMigrationGetAllAssumingMainRow, error)
This is a compatibility query for getting existing migrations before the `line` column was added to the table in version 005. We need to make sure to only select non-line properties so the query doesn't error on older schemas. (Even if we use `SELECT *` below, sqlc materializes it to a list of column names in the generated query.)
func (*Queries) RiverMigrationGetByLine ¶
func (*Queries) RiverMigrationInsert ¶
func (q *Queries) RiverMigrationInsert(ctx context.Context, db DBTX, arg *RiverMigrationInsertParams) (*RiverMigration, error)
func (*Queries) RiverMigrationInsertMany ¶
func (q *Queries) RiverMigrationInsertMany(ctx context.Context, db DBTX, arg *RiverMigrationInsertManyParams) ([]*RiverMigration, error)
func (*Queries) RiverMigrationInsertManyAssumingMain ¶
func (*Queries) RiverMigrationLock ¶ added in v0.52.0
func (q *Queries) RiverMigrationLock(ctx context.Context, db DBTX, arg *RiverMigrationLockParams) error
Takes a transaction-scoped advisory lock that serializes migrators operating on the same schema and line. An empty schema resolves to the current schema so that it serializes with migrators targeting that schema explicitly.
func (*Queries) RiverMigrationLockRefreshCatalog ¶ added in v0.52.0
Runs after RiverMigrationLock so that the transaction sees tables that other migrators created while it waited for the lock. Name lookups like `to_regclass` don't process pending catalog invalidations, so one made before the wait (even in an earlier transaction) could keep reporting a table as missing. Locking a relation for the first time in a transaction processes them, and `pg_class` always exists.
func (*Queries) SchemaGetExpired ¶
type QueueNameListParams ¶
type QueuePauseParams ¶
type QueueResumeParams ¶
type QueueUpdateParams ¶
type RiverJob ¶
type RiverJob struct {
ID int64
Args string
Attempt int16
AttemptedAt *time.Time
AttemptedBy []string
CreatedAt time.Time
Errors []string
FinalizedAt *time.Time
Kind string
MaxAttempts int16
Metadata string
Priority int16
Queue string
State RiverJobState
ScheduledAt time.Time
Tags []string
UniqueKey []byte
UniqueStates *int
}
type RiverJobState ¶
type RiverJobState string
const ( RiverJobStateAvailable RiverJobState = "available" RiverJobStateCancelled RiverJobState = "cancelled" RiverJobStateCompleted RiverJobState = "completed" RiverJobStateDiscarded RiverJobState = "discarded" RiverJobStatePending RiverJobState = "pending" RiverJobStateRetryable RiverJobState = "retryable" RiverJobStateRunning RiverJobState = "running" RiverJobStateScheduled RiverJobState = "scheduled" )
func (*RiverJobState) Scan ¶
func (e *RiverJobState) Scan(src interface{}) error
type RiverLeader ¶
type RiverMigrationLockParams ¶ added in v0.52.0
type RiverMigrationLockParams struct {
Schema sql.NullString
Line string
}
type RiverNotification ¶
type RiverQueue ¶
type SchemaGetExpiredParams ¶
type SchemaGetExpiredParams struct {
Prefix interface{}
BeforeName interface{}
}