wrapper

package
v0.9.8 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DB

type DB interface {
	Querier
	BeginTxx(ctx context.Context, opts *sql.TxOptions) (Tx, error)
	Close() error
}

DB wraps sqlx.Tx and sqlx.DB https://github.com/jmoiron/sqlx/issues/344#issuecomment-318372779

type GddDB

type GddDB struct {
	*sqlx.DB
}

GddDB wraps sqlx.DB

func (*GddDB) BeginTxx

func (g *GddDB) BeginTxx(ctx context.Context, opts *sql.TxOptions) (Tx, error)

BeginTxx begins a transaction

type GddTx

type GddTx struct {
	*sqlx.Tx
}

GddTx wraps sqlx.Tx

type Querier

type Querier interface {
	NamedExecContext(ctx context.Context, query string, arg interface{}) (sql.Result, error)
	ExecContext(ctx context.Context, query string, args ...interface{}) (sql.Result, error)
	GetContext(ctx context.Context, dest interface{}, query string, args ...interface{}) error
	Rebind(query string) string
	BindNamed(query string, arg interface{}) (string, []interface{}, error)
	SelectContext(ctx context.Context, dest interface{}, query string, args ...interface{}) error
}

Querier common operations for sqlx.Tx and sqlx.DB

type Tx

type Tx interface {
	Querier
	Commit() error
	Rollback() error
}

Tx transaction

Jump to

Keyboard shortcuts

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