Documentation ¶
Index ¶
- func Format2String(datas map[string]interface{}, key string) string
- type DataStruct
- type DbConfig
- func (config *DbConfig) BatchInsert(table string, datas []DataStruct) (num int64, err error)
- func (config *DbConfig) Close() error
- func (config *DbConfig) Connect() (err error)
- func (config *DbConfig) Count(table string, where string, args ...interface{}) (total int64, err error)
- func (config *DbConfig) Delete(table string, where string, args ...interface{}) (num int64, err error)
- func (config *DbConfig) GetOne(table, fields, where string, args ...interface{}) (map[string]interface{}, error)
- func (config *DbConfig) Insert(table string, datas DataStruct) (id int64, err error)
- func (config *DbConfig) Query(sqlString string, args ...interface{}) ([]map[string]interface{}, error)
- func (config *DbConfig) Select(table string, fields string, where string, args ...interface{}) ([]map[string]interface{}, error)
- func (config *DbConfig) Update(table string, datas DataStruct, where string, args ...interface{}) (num int64, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Format2String ¶
Types ¶
type DataStruct ¶
type DataStruct map[string]interface{}
type SetField struct { FieldName string FieldData interface{} }
type SqlValues []SetField
type DbConfig ¶
type DbConfig struct { Db *sql.DB DriverName string Addr string User string Passwd string Port string DBName string MaxOpenConns int MaxIdleConns int Debug bool }
func (*DbConfig) BatchInsert ¶
func (config *DbConfig) BatchInsert(table string, datas []DataStruct) (num int64, err error)
func (*DbConfig) GetOne ¶
func (config *DbConfig) GetOne(table, fields, where string, args ...interface{}) (map[string]interface{}, error)
获取一条
func (*DbConfig) Insert ¶
func (config *DbConfig) Insert(table string, datas DataStruct) (id int64, err error)
插入数据
Click to show internal directories.
Click to hide internal directories.