dbutil

package
v0.0.0-...-1704659 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2023 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DoTx

func DoTx(ctx context.Context, db *sqlx.DB, fn func(tx *sqlx.Tx) error) error

func DoTx1

func DoTx1[T any](ctx context.Context, db *sqlx.DB, fn func(tx *sqlx.Tx) (T, error)) (T, error)

func DoTx2

func DoTx2[A, B any](ctx context.Context, db *sqlx.DB, fn func(tx *sqlx.Tx) (A, B, error)) (A, B, error)

func NewTestDB

func NewTestDB(t testing.TB) *sqlx.DB

Types

type Reader

type Reader interface {
	Get(dst interface{}, query string, args ...interface{}) error
	Select(dst interface{}, query string, args ...interface{}) error
}

Jump to

Keyboard shortcuts

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