def fetchmany(self, size=None): if self._prefetch: res = _cursor.fetchmany(self, size) if self._query_executed: self._build_index() if not self._prefetch: res = _cursor.fetchmany(self, size) return res
def fetchmany(self, size=None): """ Fetch many tuples as ordered dictionary list. """ tuples = _cursor.fetchmany(self, size) if tuples is not None: return [self._dict_tuple(t) for t in tuples] return None
def fetchmany(self, size=None, back_as=None): ts = TupleCursor.fetchmany(self, size) cols = self.description back_as = back_as or self.back_as if back_as: try: back_as = self.connection.back_as_registry[back_as] except KeyError: raise BadBackAs(back_as, self.connection.back_as_registry) return [back_as(cols, t) for t in ts] else: return ts
def __iter__(self): if self._prefetch: res = _cursor.fetchmany(self, self.itersize) if not res: return if self._query_executed: self._build_index() if not self._prefetch: res = _cursor.fetchmany(self, self.itersize) for r in res: yield r # the above was the first itersize record. the following are # in a repeated loop. while 1: res = _cursor.fetchmany(self, self.itersize) if not res: return for r in res: yield r
def dictfetchmany(self, size): res = [] rows = _2cursor.fetchmany(self, size) for row in rows: res.append(self.__build_dict(row)) return res
def fetchmany(self, size=None): ts = _cursor.fetchmany(self, size) cols = self.description return [MutableRow(cols, t) for t in ts]
def fetchmany(self, size=None): if self._query_executed: self._build_index() return _cursor.fetchmany(self, size)
def fetchmany(self, size=None): ts = _cursor.fetchmany(self, size) nt = self.Record if nt is None: nt = self.Record = self._make_nt() return [nt(*t) for t in ts]