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