Documentation ¶
Index ¶
- type HoTimeDB
- func (that *HoTimeDB) Action(action func(db HoTimeDB) (isSuccess bool)) (isSuccess bool)
- func (that *HoTimeDB) Count(table string, qu ...interface{}) int
- func (that *HoTimeDB) Delete(table string, data map[string]interface{}) int64
- func (that *HoTimeDB) Exec(query string, args ...interface{}) (sql.Result, *Error)
- func (that *HoTimeDB) Get(table string, qu ...interface{}) Map
- func (that *HoTimeDB) GetPrefix() string
- func (that *HoTimeDB) GetType() string
- func (that *HoTimeDB) InitDb(err ...*Error) *Error
- func (that *HoTimeDB) Insert(table string, data map[string]interface{}) int64
- func (that *HoTimeDB) Page(page, pageRow int) *HoTimeDB
- func (that *HoTimeDB) PageSelect(table string, qu ...interface{}) []Map
- func (that *HoTimeDB) Query(query string, args ...interface{}) []Map
- func (that *HoTimeDB) Row(resl *sql.Rows) []Map
- func (that *HoTimeDB) Select(table string, qu ...interface{}) []Map
- func (that *HoTimeDB) SetConnect(connect func(err ...*Error) (master, slave *sql.DB), err ...*Error)
- func (that *HoTimeDB) Sum(table string, column string, qu ...interface{}) float64
- func (that *HoTimeDB) Table(table string) *HotimeDBBuilder
- func (that *HoTimeDB) Update(table string, data Map, where Map) int64
- type HotimeDBBuilder
- func (that *HotimeDBBuilder) And(qu ...interface{}) *HotimeDBBuilder
- func (that *HotimeDBBuilder) Count() int
- func (that *HotimeDBBuilder) Delete() int64
- func (that *HotimeDBBuilder) From(table string) *HotimeDBBuilder
- func (that *HotimeDBBuilder) FullJoin(table, joinStr string) *HotimeDBBuilder
- func (that *HotimeDBBuilder) Get(qu ...interface{}) Map
- func (that *HotimeDBBuilder) Group(qu ...interface{}) *HotimeDBBuilder
- func (that *HotimeDBBuilder) InnerJoin(table, joinStr string) *HotimeDBBuilder
- func (that *HotimeDBBuilder) Join(qu ...interface{}) *HotimeDBBuilder
- func (that *HotimeDBBuilder) LeftJoin(table, joinStr string) *HotimeDBBuilder
- func (that *HotimeDBBuilder) Limit(qu ...interface{}) *HotimeDBBuilder
- func (that *HotimeDBBuilder) Or(qu ...interface{}) *HotimeDBBuilder
- func (that *HotimeDBBuilder) Order(qu ...interface{}) *HotimeDBBuilder
- func (that *HotimeDBBuilder) Page(page, pageRow int) *HotimeDBBuilder
- func (that *HotimeDBBuilder) RightJoin(table, joinStr string) *HotimeDBBuilder
- func (that *HotimeDBBuilder) Select(qu ...interface{}) []Map
- func (that *HotimeDBBuilder) Update(qu ...interface{}) int64
- func (that *HotimeDBBuilder) Where(qu ...interface{}) *HotimeDBBuilder
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HoTimeDB ¶
type HoTimeDB struct { *sql.DB ContextBase DBName string *cache.HoTimeCache Log *logrus.Logger Type string Prefix string LastQuery string LastData []interface{} ConnectFunc func(err ...*Error) (*sql.DB, *sql.DB) LastErr *Error *sql.Tx //事务对象 SlaveDB *sql.DB Mode int //mode为0生产模式,1、为测试模式、2为开发模式 // contains filtered or unexported fields }
func (*HoTimeDB) PageSelect ¶
func (*HoTimeDB) SetConnect ¶
func (that *HoTimeDB) SetConnect(connect func(err ...*Error) (master, slave *sql.DB), err ...*Error)
SetConnect 设置数据库配置连接
func (*HoTimeDB) Table ¶ added in v1.2.0
func (that *HoTimeDB) Table(table string) *HotimeDBBuilder
type HotimeDBBuilder ¶ added in v1.2.0
type HotimeDBBuilder struct { HoTimeDB *HoTimeDB // contains filtered or unexported fields }
func (*HotimeDBBuilder) And ¶ added in v1.2.0
func (that *HotimeDBBuilder) And(qu ...interface{}) *HotimeDBBuilder
func (*HotimeDBBuilder) Count ¶ added in v1.2.0
func (that *HotimeDBBuilder) Count() int
func (*HotimeDBBuilder) Delete ¶ added in v1.2.0
func (that *HotimeDBBuilder) Delete() int64
func (*HotimeDBBuilder) From ¶ added in v1.2.0
func (that *HotimeDBBuilder) From(table string) *HotimeDBBuilder
func (*HotimeDBBuilder) FullJoin ¶ added in v1.2.0
func (that *HotimeDBBuilder) FullJoin(table, joinStr string) *HotimeDBBuilder
func (*HotimeDBBuilder) Get ¶ added in v1.2.0
func (that *HotimeDBBuilder) Get(qu ...interface{}) Map
func (*HotimeDBBuilder) Group ¶ added in v1.2.0
func (that *HotimeDBBuilder) Group(qu ...interface{}) *HotimeDBBuilder
func (*HotimeDBBuilder) InnerJoin ¶ added in v1.2.0
func (that *HotimeDBBuilder) InnerJoin(table, joinStr string) *HotimeDBBuilder
func (*HotimeDBBuilder) Join ¶ added in v1.2.0
func (that *HotimeDBBuilder) Join(qu ...interface{}) *HotimeDBBuilder
func (*HotimeDBBuilder) LeftJoin ¶ added in v1.2.0
func (that *HotimeDBBuilder) LeftJoin(table, joinStr string) *HotimeDBBuilder
func (*HotimeDBBuilder) Limit ¶ added in v1.2.0
func (that *HotimeDBBuilder) Limit(qu ...interface{}) *HotimeDBBuilder
func (*HotimeDBBuilder) Or ¶ added in v1.2.0
func (that *HotimeDBBuilder) Or(qu ...interface{}) *HotimeDBBuilder
func (*HotimeDBBuilder) Order ¶ added in v1.2.0
func (that *HotimeDBBuilder) Order(qu ...interface{}) *HotimeDBBuilder
func (*HotimeDBBuilder) Page ¶ added in v1.2.0
func (that *HotimeDBBuilder) Page(page, pageRow int) *HotimeDBBuilder
func (*HotimeDBBuilder) RightJoin ¶ added in v1.2.0
func (that *HotimeDBBuilder) RightJoin(table, joinStr string) *HotimeDBBuilder
func (*HotimeDBBuilder) Select ¶ added in v1.2.0
func (that *HotimeDBBuilder) Select(qu ...interface{}) []Map
func (*HotimeDBBuilder) Update ¶ added in v1.2.0
func (that *HotimeDBBuilder) Update(qu ...interface{}) int64
func (*HotimeDBBuilder) Where ¶ added in v1.2.0
func (that *HotimeDBBuilder) Where(qu ...interface{}) *HotimeDBBuilder
Click to show internal directories.
Click to hide internal directories.