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

Function RowToAddrOfStructByName

rows.go:654–658  ·  view source on GitHub ↗

RowToAddrOfStructByName returns the address of a T scanned from row. T must be a struct. T must have the same number of named public fields as row has fields. The row and T fields will be matched by name. The match is case-insensitive. The database column name can be overridden with a "db" struct ta

(row CollectableRow)

Source from the content-addressed store, hash-verified

652// case-insensitive. The database column name can be overridden with a "db" struct tag. If the "db" struct tag is "-"
653// then the field will be ignored.
654func RowToAddrOfStructByName[T any](row CollectableRow) (*T, error) {
655 var value T
656 err := (&namedStructRowScanner{ptrToStruct: &value}).ScanRow(row)
657 return &value, err
658}
659
660// RowToStructByNameLax returns a T scanned from row. T must be a struct. T must have greater than or equal number of named public
661// fields as row has fields. The row and T fields will be matched by name. The match is case-insensitive. The database

Callers

nothing calls this directly

Calls 1

ScanRowMethod · 0.65

Tested by

no test coverage detected