[英]sqlalchemy query all items, I wanna a generator or iterable object, not list, how to
some code like below: 一些类似下面的代码:
session.query(MODEL).all()
it will return all items with the type list 它将返回所有带有类型列表的项目
this means that, it will take a lots memory if there are a large amount items? 这意味着,如果有大量项目,将需要大量内存?
How can i got a iterable object, but not list. 我怎样才能得到一个可迭代的对象,但不能列出。
Year, not use all()
, and the result is a generator 年,不使用
all()
,结果是生成器
and thanks @dm03514 并感谢@ dm03514
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.