added to mapper iteration as well (courtesy Michael Twomey)
- ResultProxy will close() the underlying cursor when the ResultProxy
itself is closed. this will auto-close cursors for ResultProxy objects
that have had all their rows fetched (or had scalar() called).
+ - ResultProxy.fetchall() internally uses DBAPI fetchall() for better efficiency,
+ added to mapper iteration as well (courtesy Michael Twomey)
- SQL Construction:
- changed "for_update" parameter to accept False/True/"nowait"
and "read", the latter two of which are interpreted only by
def fetchall(self):
"""fetch all rows, just like DBAPI cursor.fetchall()."""
l = []
- while True:
- v = self.fetchone()
- if v is None:
- return l
- l.append(v)
+ for row in self.cursor.fetchall():
+ l.append(RowProxy(self, row))
+ self.close()
+ return l
def fetchone(self):
"""fetch one row, just like DBAPI cursor.fetchone()."""
for m in mappers:
otherresults.append(util.UniqueAppender([]))
- while True:
- row = cursor.fetchone()
- if row is None:
- break
+ for row in cursor.fetchall():
self._instance(context, row, result)
i = 0
for m in mappers: