Stmt returns a transaction-specific prepared statement from an existing statement.


updateMoney, err := db.Prepare("UPDATE balance SET money=money+? WHERE id=?")
tx, err := db.Begin()
res, err := tx.Stmt(updateMoney).Exec(123.45, 98293203)

The returned statement operates within the transaction and can no longer be used once the transaction has been committed or rolled back.

Stmt is referenced in 72 repositories