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)
| 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. |
| 673 | func 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 | |
| 679 | type namedStructRowScanner struct { |
| 680 | ptrToStruct any |