Documentation ¶
Index ¶
- Constants
- func DbQuery(q DBer, ty interface{}, sql string, args ...interface{}) error
- func DbQueryWithIndexFunc(q DBer, slice interface{}, f func(sliceIndex int) error, sql string, ...) error
- func DbQueryWithModelFunc(q DBer, model interface{}, f func(model interface{}) error, sql string, ...) error
- func IsThisCode(err error, code myErrCode) bool
- type DBer
- type NullData
Constants ¶
View Source
const ( NoErr myErrCode = iota // 单行查询的时候没有一行数据 NoOnceRowsDate // 需要传slice NeedSlice // 遍历使用的函数错误 SliceFuncErr )
Variables ¶
This section is empty.
Functions ¶
func DbQueryWithIndexFunc ¶
func DbQueryWithIndexFunc(q DBer, slice interface{}, f func(sliceIndex int) error, sql string, args ...interface{}) error
DbQueryWithIndexFunc 对查询的每一条结果执行f,err!=nil空时返回err
func DbQueryWithModelFunc ¶
func DbQueryWithModelFunc(q DBer, model interface{}, f func(model interface{}) error, sql string, args ...interface{}) error
DbQueryWithModelFunc 对查询的每一条结果执行f,err!=nil空时返回err
func IsThisCode ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.