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

Method ExecContext

named_context.go:37–43  ·  named_context.go::NamedStmt.ExecContext

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

(ctx context.Context, arg interface{})

Source from the content-addressed store, hash-verified

35// ExecContext executes a named statement using the struct passed.
36// Any named placeholder parameters are replaced with fields from arg.
37func (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.

Callers 2

TestNamedContextQueriesFunction · 0.95
MustExecContextMethod · 0.95

Calls 2

bindAnyArgsFunction · 0.85
ExecContextMethod · 0.65

Tested by 1

TestNamedContextQueriesFunction · 0.76