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

Method QueryRowContext

named_context.go:59–65  ·  view source on GitHub ↗

QueryRowContext executes a named statement against the database. Because sqlx cannot create a *sql.Row with an error condition pre-set for binding errors, sqlx returns a *sqlx.Row instead. Any named placeholder parameters are replaced with fields from arg.

(ctx context.Context, arg interface{})

Source from the content-addressed store, hash-verified

57// returns a *sqlx.Row instead.
58// Any named placeholder parameters are replaced with fields from arg.
59func (n *NamedStmt) QueryRowContext(ctx context.Context, arg interface{}) *Row {
60 args, err := bindAnyArgs(n.Params, arg, n.Stmt.Mapper)
61 if err != nil {
62 return &Row{err: err}
63 }
64 return n.Stmt.QueryRowxContext(ctx, args...)
65}
66
67// MustExecContext execs a NamedStmt, panicing on error
68// Any named placeholder parameters are replaced with fields from arg.

Callers 2

QueryRowxContextMethod · 0.95
TestIssue197ContextFunction · 0.80

Calls 2

bindAnyArgsFunction · 0.85
QueryRowxContextMethod · 0.65

Tested by 1

TestIssue197ContextFunction · 0.64