riverdatabasesql

package module
v0.0.0-...-862f905 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2024 License: MPL-2.0 Imports: 7 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) GetDBPool

func (d *Driver) GetDBPool() *pgxpool.Pool

func (*Driver) GetExecutor

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

func (*Driver) UnwrapExecutor

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

func (*Driver) UnwrapTx

func (d *Driver) UnwrapTx(tx *sql.Tx) pgx.Tx

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) 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) 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