Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def execute(self, query):
- """Executes a query, returning an iterator of resulting rows."""
- cursor = self._connection.cursor(convert=False)
- cursor.execute(query)
- if cursor.description:
- #column_names = [column[0] for column in cursor.description]
- #for row in cursor:
- # yield row
- while True:
- chunk = cursor.fetchmany(256)
- if chunk:
- yield chunk
- else:
- return
Add Comment
Please, Sign In to add comment