selectinload omit join
Jayson Reis
Branch: jaysonsantos/sqlalchemy:selectinload-omit-join
Branch: zzzeek/sqlalchemy:master
Declined
Declined pull request
Dear contributor - This pull request is being moved to Gerrit, at https://gerrit.sqlalchemy.org/#/c/zzzeek/sqlalchemy/+/885, where it may be tested and reviewed more closely. As such, the pull request itself is being marked "closed" or "declined", however your contribution is merely being moved to our central review system. Please register at https://gerrit.sqlalchemy.org#/register/ to send and receive comments regarding this item.
Closed by: Mike Bayer·2018-10-01
Hi there, as discussed by email [1], here I try to implement a way to make
selectloadin
bypass the join and filter right on the target table. I guess it is a bit hacky especially that I had to skip bakery to get the foreign keys (which I also don’t know if it is the right way).So, let me know what you find and if I should change/add something.
Â
[1] https://groups.google.com/forum/#!topic/sqlalchemy/x-4Ikq714_8
Add test to expect the right result from omit_join=False
Change selectinload signature to accept omit_join
Fix expected query in test_flagged_selectinload_skips_join
Change selectinload to work when omit_join is True
Right now this is suboptimal because I had to try and get the foreign keys outside of bakery.