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

Function RowToStructByNameLax

rows.go:663–667  ·  view source on GitHub ↗

RowToStructByNameLax returns 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 a "db" struct tag. If

(row CollectableRow)

Source from the content-addressed store, hash-verified

661// fields as row has fields. The row and T fields will be matched by name. The match is case-insensitive. The database
662// column name can be overridden with a "db" struct tag. If the "db" struct tag is "-" then the field will be ignored.
663func RowToStructByNameLax[T any](row CollectableRow) (T, error) {
664 var value T
665 err := (&namedStructRowScanner{ptrToStruct: &value, lax: true}).ScanRow(row)
666 return value, err
667}
668
669// RowToAddrOfStructByNameLax returns the address of a T scanned from row. T must be a struct. T must have greater than or
670// equal number of named public fields as row has fields. The row and T fields will be matched by name. The match is

Callers

nothing calls this directly

Calls 1

ScanRowMethod · 0.65

Tested by

no test coverage detected