ExecContext executes a named statement using the struct passed. Any named placeholder parameters are replaced with fields from arg.
(ctx context.Context, arg interface{})
| 35 | // ExecContext executes a named statement using the struct passed. |
| 36 | // Any named placeholder parameters are replaced with fields from arg. |
| 37 | func (n *NamedStmt) ExecContext(ctx context.Context, arg interface{}) (sql.Result, error) { |
| 38 | args, err := bindAnyArgs(n.Params, arg, n.Stmt.Mapper) |
| 39 | if err != nil { |
| 40 | return *new(sql.Result), err |
| 41 | } |
| 42 | return n.Stmt.ExecContext(ctx, args...) |
| 43 | } |
| 44 | |
| 45 | // QueryContext executes a named statement using the struct argument, returning rows. |
| 46 | // Any named placeholder parameters are replaced with fields from arg. |