- postgres no longer uses client-side cursors, uses more efficient server side
cursors via apparently undocumented psycopg2 behavior recently discovered on the
mailing list. disable it via create_engine('postgres://', client_side_cursors=True)
+ - added "fetchmany()" support to ResultProxy
- added "BIGSERIAL" support for postgres table with PGBigInteger/autoincrement
- fixes to postgres reflection to better handle when schema names are present;
thanks to jason (at) ncsmags.com [ticket:402]
self.close()
return l
+ def fetchmany(self, size=None):
+ """fetch many rows, juts like DBAPI cursor.fetchmany(size=cursor.arraysize)"""
+ if size is None:
+ rows = self.cursor.fetchmany()
+ else:
+ rows = self.cursor.fetchmany(size=size)
+ l = []
+ for row in rows:
+ l.append(RowProxy(self, row))
+ if len(l) == 0:
+ self.close()
+ return l
+
def fetchone(self):
"""fetch one row, just like DBAPI cursor.fetchone()."""
row = self.cursor.fetchone()