BeginTx starts a new transaction and returns a reference to the Tx object
(ctx context.Context)
| 72 | |
| 73 | // BeginTx starts a new transaction and returns a reference to the Tx object |
| 74 | func (pdb *db) BeginTx(ctx context.Context) (sqlplugin.Tx, error) { |
| 75 | db, err := pdb.handle.DB() |
| 76 | if err != nil { |
| 77 | // This error needs no conversion |
| 78 | return nil, err |
| 79 | } |
| 80 | tx, err := db.BeginTxx(ctx, nil) |
| 81 | if err != nil { |
| 82 | return nil, pdb.handle.ConvertError(err) |
| 83 | } |
| 84 | return newDB(pdb.dbKind, pdb.dbName, pdb.dbDriver, pdb.handle, tx, pdb.logger), nil |
| 85 | } |
| 86 | |
| 87 | // Close closes the connection to the mysql db |
| 88 | func (pdb *db) Close() error { |
nothing calls this directly
no test coverage detected