On Thursday, May 4, 2017 at 12:16:20 AM UTC-4, David Chanin wrote:
>
> How do objects get registered into the aggressive loader? Does it happen
> automatically when they're initially loaded via query or cache? Ideally we
> wanted to group items together when they're loaded and do bulk lazy
On 05/04/2017 12:07 AM, David Chanin wrote:
Interesting - so it will be possible in 1.2 to do more custom
relationship loading in a "post load" hook?
it will, however this hook is still local to the objects that are local
to the results of that Query.
Thanks for the feedback! That
How do objects get registered into the aggressive loader? Does it happen
automatically when they're initially loaded via query or cache? Ideally we
wanted to group items together when they're loaded and do bulk lazy loading
on that group rather than on all models in the session, but couldn't
Interesting - so it will be possible in 1.2 to do more custom relationship
loading in a "post load" hook?
Thanks for the feedback! That definitely makes sense - I didn't fully
understand all the logic in _emit_lazyload() initially so I wasn't sure
what was OK to remove and what wasn't. I made
We have a somewhat tangential solution that was developed when building a
read-through cache that backs into SqlAlchemy.
Instead of working on the Session, we register items for 'aggressive
loading' into a custom class instance that handles the coordination.
Our system works like this:
*
Related note, in 1.2 I'm adding a new mechanism for loading things which
is a "post load" hook, that is, a bunch of objects are loaded in a
query, and then afterwards, more loaders can run on a batch of completed
objects. The effect looks similar to how "subqueryload" works right
now,
Ack, thanks Simon! That is definitely a bug :). I just pushed a fix.
Thanks for the feedback!
David
On Wednesday, May 3, 2017 at 5:47:54 PM UTC+8, David Chanin wrote:
>
> Hi Everyone,
>
> We just open-sourced a custom lazy loader for SQLAlchemy that does bulk
> lazy loading of relations -