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

Function RowToAddrOfStructByNameLax

rows.go:673–677  ·  view source on GitHub ↗

RowToAddrOfStructByNameLax returns the address of a T scanned from row. T must be a struct. T must have greater than or equal 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

(row CollectableRow)

Source from the content-addressed store, hash-verified

671// case-insensitive. The database column name can be overridden with a "db" struct tag. If the "db" struct tag is "-"
672// then the field will be ignored.
673func RowToAddrOfStructByNameLax[T any](row CollectableRow) (*T, error) {
674 var value T
675 err := (&namedStructRowScanner{ptrToStruct: &value, lax: true}).ScanRow(row)
676 return &value, err
677}
678
679type namedStructRowScanner struct {
680 ptrToStruct any

Callers

nothing calls this directly

Calls 1

ScanRowMethod · 0.65

Tested by

no test coverage detected