-
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
Use the same database prefix as the existing rows when preloading via a lateral join #107
Use the same database prefix as the existing rows when preloading via a lateral join #107
Conversation
I don't think all the calls to Call in dataloader/lib/dataloader/ecto.ex Lines 338 to 348 in de44dc0
Should respect the Call in dataloader/lib/dataloader/ecto.ex Lines 350 to 366 in de44dc0
Should respect the Call in dataloader/lib/dataloader/ecto.ex Lines 676 to 710 in de44dc0
This one is passing the The Ecto.Association.assoc_query function does something similar, maybe it can provide a clue as to how to preserve the schema prefixes properly. |
In my (admittedly rudimentary) testing, the only data in |
From #105
I think I understand the problem now. https://hexdocs.pm/ecto/Ecto.Repo.html#c:preload/3
|
de44dc0
to
1c354b3
Compare
@mbuhot does this look good to you now? |
Yep 👍 LGTM @benwilson512 |
@benwilson512 would be great to merge this one when you get the chance and we should be in a good shape to release a new version. Thanks a lot in advance. |
Thanks for the reminder! |
This fixes the specific issue I was having in #105 (preloads not using the same database prefix as the records being preloaded from), but I don't think it will be a complete solution - there are a few other calls to
repo.all
in the file that will probably have the same problem.I'm not sure what the best approach to fixing them all in an idiomatic way would be.