riverdatabasesql

package module
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 16, 2024 License: MPL-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package riverdatabasesql bundles a River driver for Go's built in database/sql.

This is _not_ a fully functional driver, and only supports use through rivermigrate for purposes of interacting with migration frameworks like Goose. Using it with a River client will panic.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Driver

type Driver struct {
	// contains filtered or unexported fields
}

Driver is an implementation of riverdriver.Driver for database/sql.

func New

func New(dbPool *sql.DB) *Driver

New returns a new database/sql River driver for use with River.

It takes an sql.DB to use for use with River. The pool should already be configured to use the schema specified in the client's Schema field. The pool must not be closed while associated River objects are running.

This is _not_ a fully functional driver, and only supports use through rivermigrate for purposes of interacting with migration frameworks like Goose. Using it with a River client will panic.

func (*Driver) GetExecutor

func (d *Driver) GetExecutor() riverdriver.Executor

func (*Driver) GetListener added in v0.0.23

func (d *Driver) GetListener() riverdriver.Listener

func (*Driver) HasPool added in v0.0.23

func (d *Driver) HasPool() bool

func (*Driver) UnwrapExecutor

func (d *Driver) UnwrapExecutor(tx *sql.Tx) riverdriver.ExecutorTx

type Executor

type Executor struct {
	// contains filtered or unexported fields
}

func (*Executor) Begin

func (*Executor) Exec

func (e *Executor) Exec(ctx context.Context, sql string) (struct{}, error)

func (*Executor) JobCancel added in v0.0.23

func (e *Executor) JobCancel(ctx context.Context, params *riverdriver.JobCancelParams) (*rivertype.JobRow, error)

func (*Executor) JobCountByState added in v0.1.0

func (e *Executor) JobCountByState(ctx context.Context, state rivertype.JobState) (int, error)

func (*Executor) JobDeleteBefore added in v0.0.23

func (e *Executor) JobDeleteBefore(ctx context.Context, params *riverdriver.JobDeleteBeforeParams) (int, error)

func (*Executor) JobGetAvailable added in v0.0.23

func (e *Executor) JobGetAvailable(ctx context.Context, params *riverdriver.JobGetAvailableParams) ([]*rivertype.JobRow, error)

func (*Executor) JobGetByID added in v0.0.23

func (e *Executor) JobGetByID(ctx context.Context, id int64) (*rivertype.JobRow, error)

func (*Executor) JobGetByIDMany added in v0.0.23

func (e *Executor) JobGetByIDMany(ctx context.Context, id []int64) ([]*rivertype.JobRow, error)

func (*Executor) JobGetByKindAndUniqueProperties added in v0.0.23

func (e *Executor) JobGetByKindAndUniqueProperties(ctx context.Context, params *riverdriver.JobGetByKindAndUniquePropertiesParams) (*rivertype.JobRow, error)

func (*Executor) JobGetByKindMany added in v0.0.23

func (e *Executor) JobGetByKindMany(ctx context.Context, kind []string) ([]*rivertype.JobRow, error)

func (*Executor) JobGetStuck added in v0.0.23

func (e *Executor) JobGetStuck(ctx context.Context, params *riverdriver.JobGetStuckParams) ([]*rivertype.JobRow, error)

func (*Executor) JobInsertFast added in v0.0.23

func (e *Executor) JobInsertFast(ctx context.Context, params *riverdriver.JobInsertFastParams) (*rivertype.JobRow, error)

func (*Executor) JobInsertFastMany added in v0.0.23

func (e *Executor) JobInsertFastMany(ctx context.Context, params []*riverdriver.JobInsertFastParams) (int64, error)

func (*Executor) JobInsertFull added in v0.0.23

func (e *Executor) JobInsertFull(ctx context.Context, params *riverdriver.JobInsertFullParams) (*rivertype.JobRow, error)

func (*Executor) JobList added in v0.0.23

func (e *Executor) JobList(ctx context.Context, sql string, namedArgs map[string]any) ([]*rivertype.JobRow, error)

func (*Executor) JobListFields added in v0.0.23

func (e *Executor) JobListFields() string

func (*Executor) JobRescueMany added in v0.0.23

func (e *Executor) JobRescueMany(ctx context.Context, params *riverdriver.JobRescueManyParams) (*struct{}, error)

func (*Executor) JobRetry added in v0.0.23

func (e *Executor) JobRetry(ctx context.Context, id int64) (*rivertype.JobRow, error)

func (*Executor) JobSchedule added in v0.0.23

func (e *Executor) JobSchedule(ctx context.Context, params *riverdriver.JobScheduleParams) (int, error)

func (*Executor) JobSetCompleteIfRunningMany added in v0.1.0

func (e *Executor) JobSetCompleteIfRunningMany(ctx context.Context, params *riverdriver.JobSetCompleteIfRunningManyParams) ([]*rivertype.JobRow, error)

func (*Executor) JobSetStateIfRunning added in v0.0.23

func (e *Executor) JobSetStateIfRunning(ctx context.Context, params *riverdriver.JobSetStateIfRunningParams) (*rivertype.JobRow, error)

func (*Executor) JobUpdate added in v0.0.23

func (e *Executor) JobUpdate(ctx context.Context, params *riverdriver.JobUpdateParams) (*rivertype.JobRow, error)

func (*Executor) LeaderAttemptElect added in v0.0.23

func (e *Executor) LeaderAttemptElect(ctx context.Context, params *riverdriver.LeaderElectParams) (bool, error)

func (*Executor) LeaderAttemptReelect added in v0.0.23

func (e *Executor) LeaderAttemptReelect(ctx context.Context, params *riverdriver.LeaderElectParams) (bool, error)

func (*Executor) LeaderDeleteExpired added in v0.0.23

func (e *Executor) LeaderDeleteExpired(ctx context.Context, name string) (int, error)

func (*Executor) LeaderGetElectedLeader added in v0.0.23

func (e *Executor) LeaderGetElectedLeader(ctx context.Context, name string) (*riverdriver.Leader, error)

func (*Executor) LeaderInsert added in v0.0.23

func (e *Executor) LeaderInsert(ctx context.Context, params *riverdriver.LeaderInsertParams) (*riverdriver.Leader, error)

func (*Executor) LeaderResign added in v0.0.23

func (e *Executor) LeaderResign(ctx context.Context, params *riverdriver.LeaderResignParams) (bool, error)

func (*Executor) MigrationDeleteByVersionMany

func (e *Executor) MigrationDeleteByVersionMany(ctx context.Context, versions []int) ([]*riverdriver.Migration, error)

func (*Executor) MigrationGetAll

func (e *Executor) MigrationGetAll(ctx context.Context) ([]*riverdriver.Migration, error)

func (*Executor) MigrationInsertMany

func (e *Executor) MigrationInsertMany(ctx context.Context, versions []int) ([]*riverdriver.Migration, error)

func (*Executor) Notify added in v0.0.23

func (e *Executor) Notify(ctx context.Context, topic string, payload string) error

func (*Executor) PGAdvisoryXactLock added in v0.0.23

func (e *Executor) PGAdvisoryXactLock(ctx context.Context, key int64) (*struct{}, error)

func (*Executor) TableExists

func (e *Executor) TableExists(ctx context.Context, tableName string) (bool, error)

type ExecutorTx

type ExecutorTx struct {
	Executor
	// contains filtered or unexported fields
}

func (*ExecutorTx) Commit

func (t *ExecutorTx) Commit(ctx context.Context) error

func (*ExecutorTx) Rollback

func (t *ExecutorTx) Rollback(ctx context.Context) error

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL