Documentation ¶
Index ¶
- func Add(entity interface{}) (int64, error)
- func Count(sql string, params ...interface{}) (int, error)
- func FindOneMap(text string, params ...interface{}) (map[string]interface{}, int, error)
- func FindToMap(text string, params ...interface{}) ([]map[string]interface{}, int, error)
- func GetDbName(name string) string
- func GetVariable(name string) string
- func InitDB()
- func Query(sql string, dest interface{}, where ...interface{}) (interface{}, error)
- func RawRows(sql string, params ...interface{}) (*sql.Rows, error)
- func ReplaceVariable(sqlstr string) string
- func ScanRows2mapI(rows *sql.Rows) []map[string]interface{}
- type GormDB
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FindOneMap ¶
调用数据查询一条记录 返回规则: 发生错误时: {数据为nil,错误码值,错误信息} 正确时: {数据,数据数量,nil}
func ScanRows2mapI ¶
将查询结果转换成map数组,常用于原生sql查询
Types ¶
Click to show internal directories.
Click to hide internal directories.