Repository navigation
Refactor join query generation - #4156
Conversation
9cd7d61 to
9e104ea
Compare
fix and reduce code
1775330 to
99e915b
Compare
|
Hmm, so limiting a include might only be possible in postgres since postgres is the only dialect to support LATERAL JOIN's that let you reference the main table from a join. |
|
Damn. I thought I was able to do this by setting |
|
@bomattin Huh? |
|
In order to filter on includes AND limit on the main model, we had to call our finder with |
|
@bomattin It wouldn't work because of cartesian products. If you have two products with 3 tags each you get 6 rows, and LIMIT 4 would just result in one product missing tags. My thought was initially to limit in a subquery, but doesn't look like it's possible to reference the main table from a subquery used in a join. |
|
@mickhansen Can you post a test query you're trying to generate? I think I'm coming to the same conclusion you are but just want to be certain. |
|
@bomattin I'm only researching atm but looking to execute something like |
There was a problem hiding this comment.
Can identifier and foreignIdentifier be remove completely?
There was a problem hiding this comment.
That is a bit more work, but in time yes.
Refactor join query generation
|
Sweetness! |
No description provided.