Versions in this module Expand all Collapse all v1 v1.4.0 Aug 10, 2021 v1.3.4 Jul 14, 2021 Changes in this version + const DBTypeMySQL + const DBTypeSQLite3 + const TableV3Ledgers + const TableV3Payments + const TableV3Transactions + type Database interface + Begin func() error + Close func() + Commit func() error + Delete func(table string, where []Where) (sql.Result, error) + Excute func(stmt *sql.Stmt, fields []Feild) (sql.Result, error) + GetInitSQLs func() (qt, qi []string) + Init func(dbname string, dbpath string, logger *zap.Logger) error + Insert func(table string, fields []Feild) (sql.Result, error) + Prepare func(table string, fields []Feild) (*sql.Stmt, error) + PrepareTables func(ctsqls, cisqls []string) error + Rollback func() error + SelectRawSQL func(table string, sqlStr string, values []interface{}, result interface{}) 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 + SelectRowsUnion func(table string, wheres [][]Where, order *Order, paging *Paging, ...) 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, fields ...string) (*Order, error) + func (o *Order) GetOp() string + type Paging struct + CursorName string + CursorValue uint64 + Limit uint64 + func MakePaging(colName string, colValue uint64, limit uint64) *Paging + type V3Ledger struct + BlockHash string + BlockSize int + CreatedAt time.Time + GasLimit int64 + GasPrice string + GasUsed int64 + Height int64 + Id uint64 + TotalPrice *big.Int + TxCount int64 + Validator string + type V3Payment struct + Contract string + CreatedAt time.Time + EvName string + Hash string + Height int64 + Id uint64 + Idx uint + Receiver string + Sender string + Symbol string + Value string + type V3Transaction struct + Codei uint32 + Codes string + CreatedAt time.Time + Events string + GasLimit int64 + GasPrice string + GasUsed int64 + Hash string + Height int64 + Id uint64 + Memo string + Nonce int64 + Payload string + Receiver string + Sender string + Typei int + Types string + Value string + type Where struct + Name string + Op string + Value interface{} + func (w *Where) GetOp() string