Open Draykee opened 1 year ago
Hey! It took me a while to get around to this but yes, this is a very good suggestion.
This is a great feature request. Very interesting for multi-vendor applications or larger teams with defined ownership structure on data management.
Is your feature request related to a problem? Please describe.
Usecase: We want to add a relation
Product
toUser
(calledowner
) to implement an ownership. For access controll we only need the user id from the product to compare it with theactiveUserId
of theRequestContext
. Right now, the user needs to be eagerly loaded to access the id, therefore it would be awesome if we could just access the id directly from the column in the entity tableInstead of:
product.customFields.owner.id
We could directly access the id via:
product.customFields.ownerId
Describe the solution you'd like
For own entities we can achieve this in TypeORM by adding a relational definition and a defintion of the relation id to an entity:
This TypeORM definition should be created by a custom fields configuration like this:
To prevent breaking changes, the option shall be
false
by default for the next minor versions.