SqlAlchemy optimizations for read-only object models

前端 未结 3 1087
伪装坚强ぢ
伪装坚强ぢ 2021-02-03 11:59

I have a complex network of objects being spawned from a sqlite database using sqlalchemy ORM mappings. I have quite a few deeply nested:

for parent in owner.col         


        
3条回答
  •  温柔的废话
    2021-02-03 12:19

    You should be able to disable lazy loading on the relationships in question and sqlalchemy will fetch them all in a single query.

提交回复
热议问题