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

Function RowToStructByPos

rows.go:566–570  ·  view source on GitHub ↗

RowToStructByPos returns a T scanned from row. T must be a struct. T must have the same number of public fields as row has fields. The row and T fields will be matched by position. If the "db" struct tag is "-" then the field will be ignored.

(row CollectableRow)

Source from the content-addressed store, hash-verified

564// has fields. The row and T fields will be matched by position. If the "db" struct tag is "-" then the field will be
565// ignored.
566func RowToStructByPos[T any](row CollectableRow) (T, error) {
567 var value T
568 err := (&positionalStructRowScanner{ptrToStruct: &value}).ScanRow(row)
569 return value, err
570}
571
572// RowToAddrOfStructByPos returns the address of a T scanned from row. T must be a struct. T must have the same number a
573// public fields as row has fields. The row and T fields will be matched by position. If the "db" struct tag is "-" then

Callers

nothing calls this directly

Calls 1

ScanRowMethod · 0.65

Tested by

no test coverage detected