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

Method QueryRow

named.go:64–70  ·  view source on GitHub ↗

QueryRow 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.

(arg interface{})

Source from the content-addressed store, hash-verified

62// returns a *sqlx.Row instead.
63// Any named placeholder parameters are replaced with fields from arg.
64func (n *NamedStmt) QueryRow(arg interface{}) *Row {
65 args, err := bindAnyArgs(n.Params, arg, n.Stmt.Mapper)
66 if err != nil {
67 return &Row{err: err}
68 }
69 return n.Stmt.QueryRowx(args...)
70}
71
72// MustExec execs a NamedStmt, panicing on error
73// Any named placeholder parameters are replaced with fields from arg.

Callers 2

QueryRowxMethod · 0.95
TestIssue197Function · 0.80

Calls 2

bindAnyArgsFunction · 0.85
QueryRowxMethod · 0.65

Tested by 1

TestIssue197Function · 0.64