Documentation ¶
Index ¶
- Variables
- func CopyStruct(src, dst interface{})
- func Struct2Map(obj interface{}) map[string]interface{}
- func ToFloat(p string) float64
- func ToInt(p string) int
- type DbUtil
- func (t *DbUtil) DbColT() map[string]map[string]map[string]string
- func (t *DbUtil) DbConfigAdd(name string, cfg *gosql.Config)
- func (t *DbUtil) DbConfigDelete(name string)
- func (t *DbUtil) DbConfigUpdate(name string, cfg *gosql.Config)
- func (t *DbUtil) DbConnect()
- func (t *DbUtil) DbStats() (stats map[string]sql.DBStats)
- func (t *DbUtil) Model(m gosql.IModel) *_model
- func (t *DbUtil) ResCount(dbName, tbName string, filter ...interface{}) int64
- func (t *DbUtil) ResCreateMany(dbName, tbName string, dts ...map[string]interface{}) (lastInsertId int64)
- func (t *DbUtil) ResDeleteMany(dbName, tbName string, filter ...interface{}) int64
- func (t *DbUtil) ResDeleteOne(dbName, tbName string, id int) int64
- func (t *DbUtil) ResGetAll(dbName, tbName string) []map[string]interface{}
- func (t *DbUtil) ResGetMany(dbName, tbName string, fields string, groupBy string, order string, ...) []map[string]interface{}
- func (t *DbUtil) ResGetOne(dbName, tbName string, id int) map[string]interface{}
- func (t *DbUtil) ResPage(dbName, tbName string, fields string, order string, limit, offset int, ...) []map[string]interface{}
- func (t *DbUtil) ResUpdateMany(dbName, tbName string, data map[string]interface{}, filter ...interface{}) int64
- func (t *DbUtil) ResUpdateOne(dbName, tbName string, id int, dt map[string]interface{}) int64
Constants ¶
This section is empty.
Variables ¶
View Source
var Cfg = struct { Limit int }{ Limit: 1000, }
View Source
var ErrTag = struct { DbCreateError string `toml:"db_create_error"` DbDeleteError string `toml:"db_delete_error"` DbUpdateError string `toml:"db_update_error"` DbCountError string `toml:"db_count_error"` DbGetError string `toml:"db_get_error"` DbDeleteOneError string `toml:"db_delete_one_error"` DbUpdateOneError string `toml:"db_update_one_error"` DbGetOneError string `toml:"db_get_one_error"` }{ DbCreateError: "db_create_error", DbDeleteError: "db_delete_error", DbUpdateError: "db_update_error", DbCountError: "db_count_error", DbGetError: "db_get_error", DbDeleteOneError: "db_delete_one_error", DbUpdateOneError: "db_update_one_error", DbGetOneError: "db_get_one_error", }
Functions ¶
func CopyStruct ¶ added in v0.0.2
func CopyStruct(src, dst interface{})
func Struct2Map ¶ added in v0.0.2
func Struct2Map(obj interface{}) map[string]interface{}
Types ¶
type DbUtil ¶
type DbUtil struct {
// contains filtered or unexported fields
}
func (*DbUtil) DbConfigAdd ¶ added in v0.0.2
func (*DbUtil) DbConfigDelete ¶ added in v0.0.2
func (*DbUtil) DbConfigUpdate ¶ added in v0.0.2
func (*DbUtil) ResCreateMany ¶ added in v0.0.2
func (t *DbUtil) ResCreateMany(dbName, tbName string, dts ...map[string]interface{}) (lastInsertId int64)
创建记录
func (*DbUtil) ResDeleteMany ¶ added in v0.0.2
删除记录
func (*DbUtil) ResDeleteOne ¶ added in v0.0.2
func (*DbUtil) ResGetMany ¶ added in v0.0.2
func (t *DbUtil) ResGetMany(dbName, tbName string, fields string, groupBy string, order string, limit, offset int, filter ...interface{}) []map[string]interface{}
查询
Click to show internal directories.
Click to hide internal directories.