MCPcopy Create free account
hub / github.com/kataras/iris / bindSingle

Method bindSingle

x/sqlx/sqlx.go:179–186  ·  view source on GitHub ↗
(typ reflect.Type, val reflect.Value, columnTypes []*sql.ColumnType, scanner interface{ Scan(...interface{}) error })

Source from the content-addressed store, hash-verified

177}
178
179func (r *Row) bindSingle(typ reflect.Type, val reflect.Value, columnTypes []*sql.ColumnType, scanner interface{ Scan(...interface{}) error }) error {
180 fieldPtrs, err := r.lookupStructFieldPtrs(typ, val, columnTypes)
181 if err != nil {
182 return fmt.Errorf("sqlx: bind: table: %q: %w", r.Name, err)
183 }
184
185 return scanner.Scan(fieldPtrs...)
186}
187
188func (r *Row) lookupStructFieldPtrs(typ reflect.Type, val reflect.Value, columnTypes []*sql.ColumnType) ([]interface{}, error) {
189 fieldPtrs := make([]interface{}, 0, len(columnTypes))

Callers 1

BindMethod · 0.80

Calls 3

lookupStructFieldPtrsMethod · 0.95
ErrorfMethod · 0.80
ScanMethod · 0.65

Tested by

no test coverage detected