Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgraded connection fails to work in streaming mode #3

Open
adarovsky opened this issue Mar 24, 2014 · 0 comments
Open

Upgraded connection fails to work in streaming mode #3

adarovsky opened this issue Mar 24, 2014 · 0 comments

Comments

@adarovsky
Copy link

The code which works in vanilla mysql fails at mysql-utilities/utilities.js:40:5 with Uncaught TypeError: undefined is not a function

var query = connection.query('SELECT * FROM posts');
query
  .on('error', function(err) {
    // Handle error, an 'end' event will be emitted after this as well
  })
  .on('fields', function(fields) {
    // the field packets for the rows to follow
  })
  .on('result', function(row) {
    // Pausing the connnection is useful if your processing involves I/O
    connection.pause();

    processRow(row, function() {
      connection.resume();
    });
  })
  .on('end', function() {
    // all rows have been received
  });
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant