Exec executes a named statement using the struct passed. Any named placeholder parameters are replaced with fields from arg.
(arg interface{})
| 40 | // Exec executes a named statement using the struct passed. |
| 41 | // Any named placeholder parameters are replaced with fields from arg. |
| 42 | func (n *NamedStmt) Exec(arg interface{}) (sql.Result, error) { |
| 43 | args, err := bindAnyArgs(n.Params, arg, n.Stmt.Mapper) |
| 44 | if err != nil { |
| 45 | return *new(sql.Result), err |
| 46 | } |
| 47 | return n.Stmt.Exec(args...) |
| 48 | } |
| 49 | |
| 50 | // Query executes a named statement using the struct argument, returning rows. |
| 51 | // Any named placeholder parameters are replaced with fields from arg. |