Hi rustaceans! What are you working on this week? Did you discover something new, you want to share?

  • sugar_in_your_tea
    link
    fedilink
    arrow-up
    1
    ·
    edit-2
    8 months ago

    Isn’t the reverse true? If you make separate models for each query, the ORM knows exactly what data you need, so it can fetch it all as once. If you use generic models, the ORM needs to guess, and many revert to lazy loading if it’s not sure (i.e. lots of queries).

    That’s at least my experience with SQLAlchemy, we put a lot of effort in to reduce those extra calls because we’re using complex, generalized structures.