code: def parse_rest_response(self, records, rowcount, row_type=list):
          
          if self.is_plain_count:
              # result of "SELECT COUNT() FROM ... WHERE ..."
              assert list(records) == []
              yield rowcount  # originally [resp.json()['totalSize']]
          else:
              while True:
                  for row_deep in records:
                      assert self.is_aggregation == (row_deep['attributes']['type'] == 'AggregateResult')
                      row_flat = self._make_flat(row_deep, path=(), subroots=self.subroots)
                      # TODO Will be the expression "or x['done']" really correct also for long subrequests?
                      assert all(not isinstance(x, dict) or x['done'] for x in row_flat)
                      if issubclass(row_type, dict):
                          yield {k: fix_data_type(row_flat[k.lower()]) for k in self.aliases}
                      else:
                          yield [fix_data_type(row_flat[k.lower()]) for k in self.aliases]
                  # if not resp['done']:
                  #     if not cursor:
                  #         raise ProgrammingError("Must get a cursor")
                  #     resp = cursor.query_more(resp['nextRecordsUrl']).json()
                  # else:
                  #     break
                  break
docs: Parse the REST API response to DB API cursor flat response