Ejemplo n.º 1
0
 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
Ejemplo n.º 2
0
 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
Ejemplo n.º 3
0
 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
Ejemplo n.º 4
0
 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
Ejemplo n.º 5
0
 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
Ejemplo n.º 6
0
    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
Ejemplo n.º 7
0
    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
Ejemplo n.º 8
0
 def dictfetchmany(self, size):
     res = []
     rows = _2cursor.fetchmany(self, size)
     for row in rows:
         res.append(self.__build_dict(row))
     return res
Ejemplo n.º 9
0
 def dictfetchmany(self, size):
     res = []
     rows = _2cursor.fetchmany(self, size)
     for row in rows:
         res.append(self.__build_dict(row))
     return res
Ejemplo n.º 10
0
 def fetchmany(self, size=None):
     ts = _cursor.fetchmany(self, size)
     cols = self.description
     return [MutableRow(cols, t) for t in ts]
Ejemplo n.º 11
0
 def fetchmany(self, size=None):
     if self._query_executed:
         self._build_index()
     return _cursor.fetchmany(self, size)
Ejemplo n.º 12
0
 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]
Ejemplo n.º 13
0
 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]
Ejemplo n.º 14
0
 def fetchmany(self, size=None):
     if self._query_executed:
         self._build_index()
     return _cursor.fetchmany(self, size)