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

Function NamedQuery

named.go:441–447  ·  view source on GitHub ↗

NamedQuery binds a named query and then runs Query on the result using the provided Ext (sqlx.Tx, sqlx.Db). It works with both structs and with map[string]interface{} types.

(e Ext, query string, arg interface{})

Source from the content-addressed store, hash-verified

439// provided Ext (sqlx.Tx, sqlx.Db). It works with both structs and with
440// map[string]interface{} types.
441func NamedQuery(e Ext, query string, arg interface{}) (*Rows, error) {
442 q, args, err := bindNamedMapper(BindType(e.DriverName()), query, arg, mapperFor(e))
443 if err != nil {
444 return nil, err
445 }
446 return e.Queryx(q, args...)
447}
448
449// NamedExec uses BindStruct to get a query executable by the driver and
450// then runs Exec on the result. Returns an error from the binding

Callers 2

NamedQueryMethod · 0.85
NamedQueryMethod · 0.85

Calls 5

bindNamedMapperFunction · 0.85
BindTypeFunction · 0.85
mapperForFunction · 0.85
DriverNameMethod · 0.65
QueryxMethod · 0.65

Tested by

no test coverage detected