QueryRow 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.
(arg interface{})
| 62 | // returns a *sqlx.Row instead. |
| 63 | // Any named placeholder parameters are replaced with fields from arg. |
| 64 | func (n *NamedStmt) QueryRow(arg interface{}) *Row { |
| 65 | args, err := bindAnyArgs(n.Params, arg, n.Stmt.Mapper) |
| 66 | if err != nil { |
| 67 | return &Row{err: err} |
| 68 | } |
| 69 | return n.Stmt.QueryRowx(args...) |
| 70 | } |
| 71 | |
| 72 | // MustExec execs a NamedStmt, panicing on error |
| 73 | // Any named placeholder parameters are replaced with fields from arg. |