-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Incorrect Model.getIdName() return with composite keys #3410
Comments
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Nobody ? 😅 |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This issue has been closed due to continued inactivity. Thank you for your understanding. If you believe this to be in error, please contact one of the code owners, listed in the |
Hi, I didn't follow the placeholder given for the issue because this is quite simple to explain and it does'nt need any reproduction of the problem (and I'm not sure if will see that as a bug or a feature).
The problem is that when using composite keys as id, the Model.getIdName() does return only one of the composite keys fields.
For exemple :
With this model,
PostParticipants.getIdName()
will return'postId'
instead of['postId', 'memberId']
for example.I think the composite keys full support should really be implemented because even if this is not the most common scenario I can see that many issues are about composite keys..
For relation composite foreignKeys #2080
There was a good start maybe ? #126 #2046
I know that it would be a breaking change but I think that it needs to be done :)
In the meantime maybe a non breaking change fix on the
Model.getIdName()
could allow us to do some tomporary / definitive (depends on your decision to implement full support for composite keys) workaround as we would at least be aware that we are dealing with a composite keys model.Good work with loopback, it's an extraordinary tool guys 👍
Thanks for your time!
PS: I'm not native english as you can probably see. Sorry for the eventual mistakes 🤓
The text was updated successfully, but these errors were encountered: