This commit is contained in:
BaoyangChai 2019-06-28 23:13:18 +08:00
parent 5d0c0a03d7
commit 40078cba2c
1 changed files with 8 additions and 0 deletions

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 {