-
Notifications
You must be signed in to change notification settings - Fork 99
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
Query by relations, yet another version #42
Conversation
diogo patch to support relation queries
Relation queries
inner join alias name set to table name without possible shema prefix
Merge from develop
Can one of the admins verify this patch? To accept patch and trigger a build add comment ".ok\W+to\W+test." |
Compare these where the first finds records where a customer field name matches a regexp and the second finds records where a joined table's field matches a value. I think table names as properties introduces ambiguity with existing conventions of filtering. Or is it a flexibility we should embrace, being backed by the model that will decide whether a table name or field name was meant? How about this convention:
PS: I should probably discuss this in some issue instead of this PR... |
@devotis |
@raymondfeng Ah yes. Thanks. After giving it a second thought, the convention proposed by @kolach might be just fine. Thanks for your contribution @kolach . I'll probably be using it soon. |
@raymondfeng Sorry, I didn't have a chance to use the code from #41, as I was playing with my fork in parallel with @LoicMahieu My PR is only about inner (for where clause) and left outer (for order clause) joins of belongsTo relations. There are now three PR about the same subject. So I really hope the loopback team can choose the best options and let us finally have that feature in near future ;) |
@kolach Two comments:
|
|
@kolach Please ignore 2. I misread your example and thought the |
Hi @raymondfeng! Is anything that I can do to speed up the process? |
Connect to : #31 Related GH issue: strongloop/loopback#517 |
Hi @raymondfeng, do you still want to finish #44 first? With all respect... I do not any see any progress for 8 days. |
@raymondfeng The Loopback issue this PR fixes (strongloop/loopback#517) is extremely popular, is there any chance you could give @kolach feedback on what needs to be done to merge this? |
@kolach @raymondfeng are you guys still considering merging in this PR? We need this functionality in a project of ours using loopback and I'd be happy to help. In fact, I forked @kolach's branch and added a couple fixes: https://github.com/bostondv/loopback-connector/tree/query-relation
Lastly, does anyone have ideas how this might be amended to include support for Thanks! |
Can one of the admins verify this patch? |
1 similar comment
Can one of the admins verify this patch? |
@bostondv: that's cool, can you send me PR to my kolach branch please? I'm not a part of the team so it's not up to me to merge it to loopback. Joins are not the only thing that is not implemented, DISTINCT, GROUP BY are also missing. So @bostondv you need to think carefully before going forward with loopback in production. |
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. |
Can one of the admins verify this patch? |
It's now funny to read my more than one year old comments: ...I do not any see any progress for 8 days.. |
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. |
Can one of the admins verify this patch? |
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 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. |
1 similar comment
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 |
Models:
Query by retailer name brings 2 INNER JOINS:
Order clause brings LEFT JOIN:
To make it work for REST HTTP requests I had to modify loopback-datasource-juggler. Method:
I commented out all the logic about
order
parameter processing. As I need it to accept more complex objects. (But string and array are also supported)