MCPcopy
hub / github.com/jackc/pgx / ScanRow

Method ScanRow

rows.go:548–561  ·  view source on GitHub ↗
(rows Rows)

Source from the content-addressed store, hash-verified

546type mapRowScanner map[string]any
547
548func (rs *mapRowScanner) ScanRow(rows Rows) error {
549 values, err := rows.Values()
550 if err != nil {
551 return err
552 }
553
554 *rs = make(mapRowScanner, len(values))
555
556 for i := range values {
557 (*rs)[rows.FieldDescriptions()[i].Name] = values[i]
558 }
559
560 return nil
561}
562
563// RowToStructByPos returns a T scanned from row. T must be a struct. T must have the same number of public fields as row
564// has fields. The row and T fields will be matched by position. If the "db" struct tag is "-" then the field will be

Callers

nothing calls this directly

Calls 2

ValuesMethod · 0.65
FieldDescriptionsMethod · 0.65

Tested by

no test coverage detected