QueryRowContext executes a named statement against the database. Because sqlx cannot create a *sql.Row with an error condition pre-set for binding errors, sqlx returns a *sqlx.Row instead. Any named placeholder parameters are replaced with fields from arg.
(ctx context.Context, arg interface{})
| 57 | // returns a *sqlx.Row instead. |
| 58 | // Any named placeholder parameters are replaced with fields from arg. |
| 59 | func (n *NamedStmt) QueryRowContext(ctx context.Context, arg interface{}) *Row { |
| 60 | args, err := bindAnyArgs(n.Params, arg, n.Stmt.Mapper) |
| 61 | if err != nil { |
| 62 | return &Row{err: err} |
| 63 | } |
| 64 | return n.Stmt.QueryRowxContext(ctx, args...) |
| 65 | } |
| 66 | |
| 67 | // MustExecContext execs a NamedStmt, panicing on error |
| 68 | // Any named placeholder parameters are replaced with fields from arg. |