[sqlalchemy] [Q] WindowedRangeQuery recipe

2013-04-26 Thread Ladislav Lenart
Hello. I have found this recipe: http://www.sqlalchemy.org/trac/wiki/UsageRecipes/WindowedRangeQuery I think it fits perfectly for my usecase: process potentially large result set of ORM instances in chunks of predefined size to limit memory consumption. I have few questions / remarks: * I

Re: [sqlalchemy] [Q] WindowedRangeQuery recipe

2013-04-26 Thread Gunnlaugur Thor Briem
No, the comma is supposed to be there; it's for tuple unpacking. The iterable q yields tuples (which in this case are of length one, because the resultset has only one column). The column should be whatever attribute of the ORM instances you want to sort by, not necessarily the primary key. The

Re: [sqlalchemy] [Q] WindowedRangeQuery recipe

2013-04-26 Thread Ladislav Lenart
Hello. I think I understand it all now. Thank you, Ladislav Lenart On 26.4.2013 13:22, Gunnlaugur Thor Briem wrote: No, the comma is supposed to be there; it's for tuple unpacking. The iterable q yields tuples (which in this case are of length one, because the resultset has only one