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

Method Query

named.go:52–58  ·  view source on GitHub ↗

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

(arg interface{})

Source from the content-addressed store, hash-verified

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

Callers 1

QueryxMethod · 0.95

Calls 2

bindAnyArgsFunction · 0.85
QueryMethod · 0.65

Tested by

no test coverage detected