mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-18 00:34:28 +08:00
add comments
This commit is contained in:
@@ -2,10 +2,12 @@ package datastore
|
||||
|
||||
import "xorm.io/xorm"
|
||||
|
||||
// Database represents a database instance
|
||||
type Database struct {
|
||||
*xorm.EngineGroup
|
||||
}
|
||||
|
||||
// DoTransaction runs a new database transaction
|
||||
func (db *Database) DoTransaction(fn func(sess *xorm.Session) error) (err error) {
|
||||
sess := db.NewSession()
|
||||
defer sess.Close()
|
||||
|
||||
Reference in New Issue
Block a user