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)
| 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. |
| 654 | func 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 |