Skip to content

Commit db69506

Browse files
author
xiangtieyao
committed
Add Tx.NamedExecContext method
1 parent 8ed836a commit db69506

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

sqlx_context.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,12 @@ func (tx *Tx) QueryRowxContext(ctx context.Context, query string, args ...interf
273273
return &Row{rows: rows, err: err, unsafe: tx.unsafe, Mapper: tx.Mapper}
274274
}
275275

276+
// NamedExecContext using this Tx.
277+
// Any named placeholder parameters are replaced with fields from arg.
278+
func (tx *Tx) NamedExecContext(ctx context.Context, query string, arg interface{}) (sql.Result, error) {
279+
return NamedExecContext(ctx, tx, query, arg)
280+
}
281+
276282
// SelectContext using the prepared statement.
277283
// Any placeholder parameters are replaced with supplied args.
278284
func (s *Stmt) SelectContext(ctx context.Context, dest interface{}, args ...interface{}) error {

0 commit comments

Comments
 (0)