This is really confusing. On one hand, we use PrimaryKey to describe db structure by having column names in it. And now, we use the same object to store primary key value.
Additionally, primaryKeyValue is created by taking some fields from item and we pass both of them to this function - it doesn't make too much sense.
We should instead add a method to Item e.g. getPrimaryKeyValue and use this method here. And I think we should have separate types for PrimaryKey and PrimaryKeyValue just to avoid them being confused with each other.
When I was writing this code I realized this can be confusing. Didn't really have an idea on how to overcome this.
We can do getPrimaryKeyValue and also "separate" these types: PrimaryKey and PrimaryKeyValue. My idea is that they can be the same but have different names just to make it more clear.