Query executes a named statement using the struct argument, returning rows. Any named placeholder parameters are replaced with fields from arg.
(arg interface{})
| 50 | // Query executes a named statement using the struct argument, returning rows. |
| 51 | // Any named placeholder parameters are replaced with fields from arg. |
| 52 | func (n *NamedStmt) Query(arg interface{}) (*sql.Rows, error) { |
| 53 | args, err := bindAnyArgs(n.Params, arg, n.Stmt.Mapper) |
| 54 | if err != nil { |
| 55 | return nil, err |
| 56 | } |
| 57 | return n.Stmt.Query(args...) |
| 58 | } |
| 59 | |
| 60 | // QueryRow executes a named statement against the database. Because sqlx cannot |
| 61 | // create a *sql.Row with an error condition pre-set for binding errors, sqlx |
no test coverage detected