NamedQuery binds a named query and then runs Query on the result using the provided Ext (sqlx.Tx, sqlx.Db). It works with both structs and with map[string]interface{} types.
(e Ext, query string, arg interface{})
| 439 | // provided Ext (sqlx.Tx, sqlx.Db). It works with both structs and with |
| 440 | // map[string]interface{} types. |
| 441 | func NamedQuery(e Ext, query string, arg interface{}) (*Rows, error) { |
| 442 | q, args, err := bindNamedMapper(BindType(e.DriverName()), query, arg, mapperFor(e)) |
| 443 | if err != nil { |
| 444 | return nil, err |
| 445 | } |
| 446 | return e.Queryx(q, args...) |
| 447 | } |
| 448 | |
| 449 | // NamedExec uses BindStruct to get a query executable by the driver and |
| 450 | // then runs Exec on the result. Returns an error from the binding |
no test coverage detected