Adding stream cursor functionality, similar to MySQLdb