Documentation ¶
Index ¶
- type DB
- func (db *DB) BlockLogger()
- func (db *DB) Exec(sql string, args ...interface{}) error
- func (db *DB) GetDriver() *gorm.DB
- func (db *DB) QueryMore(sql string, args ...interface{}) (*sql.Rows, error)
- func (db *DB) QueryOne(dest interface{}, sql string, args ...interface{}) error
- func (db *DB) ScanRows(rows *sql.Rows, dest interface{}) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
DB simple wrapper of Gorm
func NewDBWithMockForTest ¶
NewDBWithMockForTest return a new DB instance JUST FOR TESTS JUST FOR TESTS JUST FOR TESTS
func (*DB) BlockLogger ¶ added in v0.0.8
func (db *DB) BlockLogger()
func (*DB) QueryMore ¶
QueryMore 查询多个结果,返回的结果需要配合 ScanRows 使用 example: rows, _ := db.QueryMore("SELECT * FROM table LIMIT 10")
for rows.Next(){ _ = db.ScanRows(rows, &dest) }
Click to show internal directories.
Click to hide internal directories.