sqlexec

package
v0.4.4 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2020 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExecTx

func ExecTx(trans Transactor, opt *sql.TxOptions, actions func(*sql.Tx) error) (err error)

ExecTx closes over a transaction and automatically commits, or rollbacks depending on whether errors were encountered.

func ExecTxContext

func ExecTxContext(ctx context.Context, trans Transactor, opt *sql.TxOptions, actions func(*sql.Tx) error) (err error)

ExecTxContext executes a transaction with an associated context.

Types

type Transactor

type Transactor interface {
	BeginTx(ctx context.Context, opts *sql.TxOptions) (*sql.Tx, error)
}

Transactor defines a common set of methods for working with database transactions.

Jump to

Keyboard shortcuts

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