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

Function GetContext

sqlx_context.go:82–85  ·  sqlx_context.go::GetContext

GetContext does a QueryRow using the provided Queryer, and scans the resulting row to dest. If dest is scannable, the result must only have one column. Otherwise, StructScan is used. Get will return sql.ErrNoRows like row.Scan would. Any placeholder parameters are replaced with supplied args. An e

(ctx context.Context, q QueryerContext, dest interface{}, query string, args ...interface{})

Source from the content-addressed store, hash-verified

80// row.Scan would. Any placeholder parameters are replaced with supplied args.
81// An error is returned if the result set is empty.
82func GetContext(ctx context.Context, q QueryerContext, dest interface{}, query string, args ...interface{}) error {
83 r := q.QueryRowxContext(ctx, query, args...)
84 return r.scanAny(dest, false)
85}
86
87// LoadFileContext exec's every statement in a file (as a single call to Exec).
88// LoadFileContext may return a nil *sql.Result if errors are encountered

Callers 4

GetContextMethod · 0.85
GetContextMethod · 0.85
GetContextMethod · 0.85
GetContextMethod · 0.85

Calls 2

scanAnyMethod · 0.80
QueryRowxContextMethod · 0.65

Tested by

no test coverage detected