sqlh

package
v0.0.0-...-07f0968 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoRows   = sql.ErrNoRows
	ErrConnDone = sql.ErrConnDone
	ErrTxDone   = sql.ErrTxDone
)

Functions

func Asc

func Asc(asc bool) string

func GtLtSymbol

func GtLtSymbol(asc bool) string

func In

func In(query string, args ...interface{}) (string, []interface{})

func InCondition

func InCondition(and bool, field string, setLen int) string

func IsNoRows

func IsNoRows(err error) bool

func Limit

func Limit(l, max uint16) uint16

func Limit100

func Limit100(l uint16) uint16

func NPList

func NPList(n, p int) string

func Named

func Named(query string, arg interface{}) (string, []interface{})

func OrderByField

func OrderByField(field string, setLen int) string

func OrderLimit

func OrderLimit(field string, asc bool, l, max uint16) string

func OrderLimit100

func OrderLimit100(field string, asc bool, l uint16) string

func PList

func PList(p int) string

func PanicIfIsntNoRows

func PanicIfIsntNoRows(err error)

func ReturnNotFoundIfIsNoRows

func ReturnNotFoundIfIsNoRows(err error)

Types

type Args

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

func NewArgs

func NewArgs(size int) *Args

func (*Args) Append

func (a *Args) Append(arg ...interface{})

func (*Args) Is

func (a *Args) Is() []interface{}

type ReplicaSet

type ReplicaSet interface {
	Primary() *sqlx.DB
	Slaves() []*sqlx.DB
	RandSlave() *sqlx.DB
	SetConnMaxLifetime(d time.Duration)
	SetMaxIdleConns(n int)
	SetMaxOpenConns(n int)
}

func MustNewReplicaSet

func MustNewReplicaSet(primaryDataSourceName string, slaveDataSourceNames ...string) ReplicaSet

func NewReplicaSet

func NewReplicaSet(primaryDataSourceName string, slaveDataSourceNames ...string) (ReplicaSet, error)

type Row

type Row interface {
	Scan(dst ...interface{}) error
}

Jump to

Keyboard shortcuts

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