From 40078cba2cc3e243801b731e9a50aeab20eff4a8 Mon Sep 17 00:00:00 2001 From: BaoyangChai Date: Fri, 28 Jun 2019 23:13:18 +0800 Subject: [PATCH] update --- orm/db_alias.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/orm/db_alias.go b/orm/db_alias.go index 9cb42748..51ce10f3 100644 --- a/orm/db_alias.go +++ b/orm/db_alias.go @@ -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 {