BeginTxx begins a transaction and returns an *sqlx.Tx instead of an *sql.Tx. The provided context is used until the transaction is committed or rolled back. If the context is canceled, the sql package will roll back the transaction. Tx.Commit will return an error if the context provided to BeginxCo
(ctx context.Context, opts *sql.TxOptions)
| 202 | // transaction. Tx.Commit will return an error if the context provided to |
| 203 | // BeginxContext is canceled. |
| 204 | func (db *DB) BeginTxx(ctx context.Context, opts *sql.TxOptions) (*Tx, error) { |
| 205 | tx, err := db.DB.BeginTx(ctx, opts) |
| 206 | if err != nil { |
| 207 | return nil, err |
| 208 | } |
| 209 | return &Tx{Tx: tx, driverName: db.driverName, unsafe: db.unsafe, Mapper: db.Mapper}, err |
| 210 | } |
| 211 | |
| 212 | // Connx returns an *sqlx.Conn instead of an *sql.Conn. |
| 213 | func (db *DB) Connx(ctx context.Context) (*Conn, error) { |
no outgoing calls