1
0
mirror of https://github.com/astaxie/beego.git synced 2024-12-22 18:10:48 +00:00
This commit is contained in:
BaoyangChai 2019-06-28 23:13:18 +08:00
parent 5d0c0a03d7
commit 40078cba2c

View File

@ -110,6 +110,14 @@ type DB struct {
stmts map[string]*sql.Stmt
}
func (d *DB) Begin() (*sql.Tx, error) {
return d.DB.Begin()
}
func (d *DB) BeginTx(ctx context.Context, opts *sql.TxOptions) (*sql.Tx, error) {
return d.DB.BeginTx(ctx, opts)
}
func (d *DB) getStmt(query string) (*sql.Stmt, error) {
d.RLock()
if stmt, ok := d.stmts[query]; ok {