db

package
v0.0.0-...-dd85d06 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DBConn

type DBConn struct {
	*sqlx.DB
}

func NewDBConn

func NewDBConn(ctx context.Context, c config.DB) (*DBConn, error)

func (*DBConn) ExecContext

func (conn *DBConn) ExecContext(ctx context.Context, query string, args ...any) (sql.Result, error)

func (*DBConn) NamedExecContext

func (conn *DBConn) NamedExecContext(ctx context.Context, query string, arg interface{}) (sql.Result, error)

func (*DBConn) QueryxContext

func (conn *DBConn) QueryxContext(ctx context.Context, query string, args ...any) (*sqlx.Rows, error)

func (*DBConn) RunInTx

func (conn *DBConn) RunInTx(ctx context.Context, run func(ctx context.Context) error) error

func (*DBConn) SelectContext

func (conn *DBConn) SelectContext(ctx context.Context, dest interface{}, query string, args ...interface{}) error

type Logger

type Logger struct {
	*log.Logger
}

type Transactioner

type Transactioner interface {
	storage.Queryer
	RunInTx(context.Context, func(ctx context.Context) error) error
}

type Tx

type Tx struct {
	*sqlx.Tx
}

func ExtractTransactionFromContext

func ExtractTransactionFromContext(ctx context.Context) *Tx

Jump to

Keyboard shortcuts

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