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

Method QueryContext

named_context.go:47–53  ·  view source on GitHub ↗

QueryContext executes a named statement using the struct argument, returning rows. Any named placeholder parameters are replaced with fields from arg.

(ctx context.Context, arg interface{})

Source from the content-addressed store, hash-verified

45// QueryContext executes a named statement using the struct argument, returning rows.
46// Any named placeholder parameters are replaced with fields from arg.
47func (n *NamedStmt) QueryContext(ctx context.Context, arg interface{}) (*sql.Rows, error) {
48 args, err := bindAnyArgs(n.Params, arg, n.Stmt.Mapper)
49 if err != nil {
50 return nil, err
51 }
52 return n.Stmt.QueryContext(ctx, args...)
53}
54
55// QueryRowContext executes a named statement against the database. Because sqlx cannot
56// create a *sql.Row with an error condition pre-set for binding errors, sqlx

Callers 1

QueryxContextMethod · 0.95

Calls 2

bindAnyArgsFunction · 0.85
QueryContextMethod · 0.65

Tested by

no test coverage detected