zsql

package
v0.5.4 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2022 License: MIT Imports: 2 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithTx

func WithTx(db DB, handler TxHandler) (err error)

Execute a transaction using a closure

func WithTxx added in v0.5.3

func WithTxx(db DBx, handler TxxHandler) (err error)

Execute a sqlx transaction using a closure

func WithoutTx

func WithoutTx(db DB, handler TxHandler) (err error)

Do something with a closure using the same API as WithTx, but no transaction

Types

type DB

type DB interface {
	Begin() (*sql.Tx, error)
}

type DBx added in v0.5.3

type DBx interface {
	Beginx() (*sqlx.Tx, error)
}

type Exec

type Exec interface {
	Exec(query string, arguments ...interface{}) (sql.Result, error)
}

type Execx added in v0.5.3

type Execx interface {
	NamedExec(query string, arguments interface{}) (sql.Result, error)
}

type TxHandler

type TxHandler = func(tx Exec) error

type TxxHandler added in v0.5.3

type TxxHandler = func(tx Execx) error

Jump to

Keyboard shortcuts

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