mysqlnode.jssequelize.js

How can I set up Sequelize.js to stream data instead of a promise / callback?


I am using MySQL and have a very large response (15,000+ rows). This takes.. well.. time. But I can start to process the first result right away. Can I set up a stream somehow with sequelize? If so, how?


Solution

  • There is a related GitHub for this. It doesn't look like it will happen in the near future.

    For now I am monitoring my console, saving the query that Sequelize generates, and then refactoring my code to run the query with node-mysql.

    connection.query(mySavedQuery).stream().pipe(...)