erikd
mentioned this pull request
Closed
For a composite reference, the foreign fields have to be checked against the parent fields for type equality. The parent field are found by searching the parent Entity, using 'getFD'. For the foreign fields,though, this is unecessary. Currently, for each composite field, we extract its fields name and search again for the same field using 'getFd'. This creates an unecessary round trip.
This required a small tweak to TH. This is because when the primary key is autogenerated it has an extra layer. So when TH defines a function :: ChildFields -> ParentKey, we need an extra unwrapping.
The `References` keyword can be omitted to have backwords compatibility. The fields before and after the key word must have the same length (and are type checked as before).
TH needed a small tweak, because the function ChildFields -> ParentKey can't be generated when we reference manual fields. This is just a utility function and missing it in this case shouldn't create any issues.
parsonsmatt changed the base branch from master to foreign-key-improvements
October 30, 2020 18:51Merged
5 tasks