mirror of
https://github.com/astaxie/beego.git
synced 2024-11-29 10:51:28 +00:00
Add DBStats method wrapper to provide sql.DBStats when using ormer
This commit is contained in:
parent
80aabdd372
commit
2ae480556d
@ -522,6 +522,11 @@ func (o *orm) Driver() Driver {
|
|||||||
return driver(o.alias.Name)
|
return driver(o.alias.Name)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// return sql.DBStats for current database
|
||||||
|
func (o *orm) DBStats() sql.DBStats {
|
||||||
|
return o.alias.DB.Stats()
|
||||||
|
}
|
||||||
|
|
||||||
// NewOrm create new orm
|
// NewOrm create new orm
|
||||||
func NewOrm() Ormer {
|
func NewOrm() Ormer {
|
||||||
BootStrap() // execute only once
|
BootStrap() // execute only once
|
||||||
|
@ -128,6 +128,7 @@ type Ormer interface {
|
|||||||
// // update user testing's name to slene
|
// // update user testing's name to slene
|
||||||
Raw(query string, args ...interface{}) RawSeter
|
Raw(query string, args ...interface{}) RawSeter
|
||||||
Driver() Driver
|
Driver() Driver
|
||||||
|
DBStats() sql.DBStats
|
||||||
}
|
}
|
||||||
|
|
||||||
// Inserter insert prepared statement
|
// Inserter insert prepared statement
|
||||||
|
Loading…
Reference in New Issue
Block a user