-
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
Multiple foreignkeys possibility in Model Relation? #2080
Comments
@chojowliu I think we support composite id, see docs here: I am not sure is composite foreign key supported ATM, @raymondfeng could you confirm it? Thanks a lot. |
@jannyHou I do know loopback support composite id, but not in the relation section
|
anyone? |
@jannyHou any update on this? I search the web, it seems like people are asking for the same question I have, but none of them been answered. |
@raymondfeng could you confirm whether we support composite foreignKey? Thanks a lot! |
I would like to know also |
+1 |
For anyone interested in |
+1 |
+1 I welcome even suggestion where to look into the code of loopback and how to try to implement it on my own. |
I would mark this rather than feature as major issue, as this is preventing usage of loopback in certain scenarios. I of course understand there is workaround by going with custom method with custom SQL queries where I can write the joins using multiple keys by hand. But it is breaking the beauty of model driven design of loopback and in general I think direct SQL queries method should be used only in edge scenarios as temporary workaround. |
@archenroot make sense. Labelled it as major |
Copied from #2955 (comment)
|
+1 |
1 similar comment
+1 |
Anyone also interested in this feature please do 👍 on the first comment :) instead of adding new comments. Thanks! |
Any update on this? |
This story is already in backlog, we will make an investigation in the future. |
Possibly related: #2046 |
and also #126 |
+1 |
Given that [email protected] is coming soon, we're not going to be making new features for core components. |
+1 |
1 similar comment
+1 |
still looking for multiple ids / keys support... |
+1 |
@kjdelisle - what was the reason for closing this issue? Fact that [email protected] has this feature built in or fact that you simply don't have time to look at this or that we should ask for this feature within connectors instead of core? Thanks for answer. |
@ALL - I opened this issue on Oracle and Postgres connector as well, but it is being overlooked at all.... loopbackio/loopback-connector-oracle#87 |
News about this feature in loopback 4? |
Hello, LoopBack 4.0 release is very close, we don't have bandwidth to work on composite foreign keys in LoopBack 3.x. I opened a new issue in loopback-next, I'd like us to consider the problem of composite keys in a wider context. Let's move further discussions to the new issue please. |
In the loopback model relations section, you can specificity a foreignKey to be referenced in the other model. As far as I know, It will only take one field, but what about I have a composite primary key and want to be referenced in the other model?
Can I do something like?
"foreignKey":["id1","id2"]
The text was updated successfully, but these errors were encountered: