-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
[SPIKE]Legacy Juggler - Providing repositories based on relations #995
Comments
Can't wait to see this feature in loopback-next.. |
Cross posting from #419
|
@dhmlau I think this spike can focus on building the skeleton for the navigation among models(repositories), we can consider it as a factory, any specific relation's details can be discussed in separate stories. The pseudo code is a great start, a few questions based on it:
|
@raymondfeng I've been trying to create a test app that demonstrates the use case here. I would greatly appreciate some guidance based on @jannyHou's concerns and the following:
Can we leverage RepositoryMetadata to reverse lookup the repo based on the model? Assuming a |
is it possible to rename model relation to
Like in Hibernate, Doctrine or TypeOrm |
@sbacem thank you for your comment. I think it is possible to use that naming convention and I feel it makes it more intuitive and show the relationship from both sides of the field. It might actually make it easier to describe relationships in one shot as opposed to say having two complimentary decorators (for e.g. |
Sorry for the late update, everyone. You can find some of the prototype code in the spike #1194. We have discussed about the findings and here is my proposed list of tasks to come out of this:
There are notes at https://github.com/strongloop/loopback-next/blob/b4da30ed38b897f8804a655a0a64240cbb0962f5/docs/site/Model-relations.md as well. From @bajtos,
This sentiment is shared by myself and others on the team, and I'm working on the first increments described above in a new PR. |
spike is complete. |
Timeboxed to 2 weeks from start
Overview
We need to build support in the legacy juggler bridge to allow usage of the current juggler's relation engine. To do this, we need to answer some questions about what form and format it will take.
Scenario
In this scenario, we want to retrieve the relationship that connects a Customer to their Orders so that we can return a Customer with its Orders embedded in it as a part of the call to
getCustomerWithOrders
.Example pseudo-TS:
Questions to Answer
OrderRepository
usingOrder
)?update
function of the wrapped repo doesn't allow editing of the foreign keycustomerId
on orders since that breaks the relationship constraint)The text was updated successfully, but these errors were encountered: