Skip to content

Commit

Permalink
Add missing PreparexContext function
Browse files Browse the repository at this point in the history
  • Loading branch information
c4milo committed Jun 17, 2017
1 parent d9bd385 commit 502e7d6
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions sqlx_context.go
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,14 @@ func (tx *Tx) NamedStmtContext(ctx context.Context, stmt *NamedStmt) *NamedStmt
}
}

// PreparexContext returns an sqlx.Stmt instead of a sql.Stmt.
//
// The provided context is used for the preparation of the statement, not for
// the execution of the statement.
func (tx *Tx) PreparexContext(ctx context.Context, query string) (*Stmt, error) {
return PreparexContext(ctx, tx, query)
}

// MustExecContext runs MustExecContext within a transaction.
// Any placeholder parameters are replaced with supplied args.
func (tx *Tx) MustExecContext(ctx context.Context, query string, args ...interface{}) sql.Result {
Expand Down

0 comments on commit 502e7d6

Please sign in to comment.