Versions in this module Expand all Collapse all v0 v0.1.0 Dec 10, 2018 Changes in this version + const DBTypeMySQL + const DBTypeSQLite3 + type Database interface + Begin func() error + Close func() + Commit func() error + Count func(table string, where []Where) (int, error) + Delete func(table string, where []Where) (sql.Result, error) + Init func(dbname string, cfg *viper.Viper, logger *zap.Logger) error + InitTables func(ctsqls, cisqls []string) error + Insert func(table string, feilds []Feild) (sql.Result, error) + Replace func(table string, feilds []Feild) (sql.Result, error) + Rollback func() error + SelectRows func(table string, where []Where, order *Order, paging *Paging, result interface{}) error + SelectRowsOffset func(table string, where []Where, order *Order, offset, limit uint64, ...) error + Update func(table string, toupdate []Feild, where []Where) (sql.Result, error) + type Feild struct + Name string + Value interface{} + type Order struct + Feilds []string + Type string + func MakeOrder(ordertype string, feilds ...string) (*Order, error) + func (o *Order) GetOp() string + type Paging struct + CursorName string + CursorValue uint64 + Limit uint + func MakePaging(colName string, colValue uint64, limit uint) *Paging + type Where struct + Name string + Op string + Value interface{} + func (w *Where) GetOp() string