MCPcopy
hub / github.com/jmoiron/sqlx / Exec

Method Exec

named.go:42–48  ·  view source on GitHub ↗

Exec executes a named statement using the struct passed. Any named placeholder parameters are replaced with fields from arg.

(arg interface{})

Source from the content-addressed store, hash-verified

40// Exec executes a named statement using the struct passed.
41// Any named placeholder parameters are replaced with fields from arg.
42func (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.

Callers 2

TestNamedQueriesFunction · 0.95
MustExecMethod · 0.95

Calls 2

bindAnyArgsFunction · 0.85
ExecMethod · 0.65

Tested by 1

TestNamedQueriesFunction · 0.76