1
0
mirror of https://github.com/astaxie/beego.git synced 2024-11-26 02:51:28 +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 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) { func (d *DB) getStmt(query string) (*sql.Stmt, error) {
d.RLock() d.RLock()
if stmt, ok := d.stmts[query]; ok { if stmt, ok := d.stmts[query]; ok {