djangosnippets.org: Latest snippets tagged with 'fetchmany'https://djangosnippets.org/tags/fetchmany/2009-01-08T02:13:06.075286-06:00iter_fetchmany
2009-01-08T02:13:06.075286-06:00jdunckhttps://djangosnippets.org/snippets/1280/<p>When executing custom sql, the temptation is to use fetchall or fetchone, since the API for fetchmany is a bit awkward. (fetchall makes all records resident in client memory at once; fetchone takes a network round-trip to the DB for each record.)</p>
<p>This snippet, hoisted from django.db.models.sql.query.results_iter, presents a nice, …</p>
Freely redistributable