RowToStructByName returns 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 tag. If the "db" struct
(row CollectableRow)
| 642 | // fields as row has fields. The row and T fields will be matched by name. The match is case-insensitive. The database |
| 643 | // column name can be overridden with a "db" struct tag. If the "db" struct tag is "-" then the field will be ignored. |
| 644 | func RowToStructByName[T any](row CollectableRow) (T, error) { |
| 645 | var value T |
| 646 | err := (&namedStructRowScanner{ptrToStruct: &value}).ScanRow(row) |
| 647 | return value, err |
| 648 | } |
| 649 | |
| 650 | // RowToAddrOfStructByName returns the address of a T scanned from row. T must be a struct. T must have the same number |
| 651 | // of named public fields as row has fields. The row and T fields will be matched by name. The match is |