BeginTx starts a new transaction and returns a reference to the Tx object
(ctx context.Context)
| 57 | |
| 58 | // BeginTx starts a new transaction and returns a reference to the Tx object |
| 59 | func (mdb *db) BeginTx(ctx context.Context) (sqlplugin.Tx, error) { |
| 60 | xtx, err := mdb.db.BeginTxx(ctx, nil) |
| 61 | if err != nil { |
| 62 | return nil, err |
| 63 | } |
| 64 | return newDB(mdb.dbKind, mdb.dbName, mdb.db, xtx, mdb.logger), nil |
| 65 | } |
| 66 | |
| 67 | // Commit commits a previously started transaction |
| 68 | func (mdb *db) Commit() error { |