regular

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2024 License: MIT Imports: 6 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 {
	Begin(ctx context.Context) (pgx.Tx, error)
	Query(ctx context.Context, query string, args ...interface{}) (pgx.Rows, error)
	QueryRow(ctx context.Context, query string, args ...interface{}) pgx.Row
	Exec(ctx context.Context, query string, args ...interface{}) (pgconn.CommandTag, error)
}

type Instance

type Instance struct {
	// contains filtered or unexported fields
}

func New

func New(db Pool) *Instance

func (*Instance) Begin

func (ins *Instance) Begin(ctx context.Context) (pgx.Tx, error)

func (*Instance) BeginTx

func (ins *Instance) BeginTx(ctx context.Context, opts pgx.TxOptions) (pgx.Tx, error)

func (*Instance) Exec

func (ins *Instance) Exec(ctx context.Context, query string, args ...interface{}) (pgconn.CommandTag, error)

func (*Instance) Query

func (ins *Instance) Query(ctx context.Context, query string, args ...interface{}) (pgx.Rows, error)

func (*Instance) QueryRow

func (ins *Instance) QueryRow(ctx context.Context, query string, args ...interface{}) pgx.Row

func (*Instance) Transactional

func (ins *Instance) Transactional(ctx context.Context, fn func(ctx context.Context) error) (out error)

type Pool

type Pool interface {
	BeginTx(ctx context.Context, opts pgx.TxOptions) (pgx.Tx, error)
	Begin(ctx context.Context) (pgx.Tx, error)
	Query(ctx context.Context, query string, args ...interface{}) (pgx.Rows, error)
	QueryRow(ctx context.Context, query string, args ...interface{}) pgx.Row
	Exec(ctx context.Context, query string, args ...interface{}) (pgconn.CommandTag, error)
}

Jump to

Keyboard shortcuts

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