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