I would like to allow defining the following:
User
id Int64
...
Primary ...
-
This should suppress all the existing magic such as generating a UserId type.
-
UserId would be an EntityField User Int64.
-
The User type would include a userId :: Int64 field.
-
All the Key-based stuff would be based on the Primary field.
As I have used persistent more and more, I have noticed that a lot of the pain points are either due to not being able to treat regular fields more like id, or due to not being able to treat id more like a regular field. So I would like to slowly unify id with other fields in a backwards compatible way.
This change in isolation is less useful than it will be after changes like #995 are implemented, but I similarly think that #995 is less useful without this change. So I think it makes sense to implement this first in isolation.
I would like to allow defining the following:
This should suppress all the existing magic such as generating a
UserIdtype.UserIdwould be anEntityField User Int64.The
Usertype would include auserId :: Int64field.All the
Key-based stuff would be based on thePrimaryfield.As I have used persistent more and more, I have noticed that a lot of the pain points are either due to not being able to treat regular fields more like
id, or due to not being able to treatidmore like a regular field. So I would like to slowly unifyidwith other fields in a backwards compatible way.This change in isolation is less useful than it will be after changes like #995 are implemented, but I similarly think that #995 is less useful without this change. So I think it makes sense to implement this first in isolation.