node-pg-query-stream icon indicating copy to clipboard operation
node-pg-query-stream copied to clipboard

TypeError: self.activeQuery.handleEmptyQuery is not a function

Open chriszrc opened this issue 7 years ago • 1 comments

It appears that QueryStream cannot handle queries that only return a few rows (less than 100). Here is the full stack trace:

TypeError: self.activeQuery.handleEmptyQuery is not a function
    at Connection.<anonymous> (/Users/user/github/proj/server/app/node_modules/pg/lib/client.js:227:22)
    at emitOne (events.js:116:13)
    at Connection.emit (events.js:211:7)
    at Socket.<anonymous> (/Users/user/github/proj/server/app/node_modules/pg/lib/connection.js:118:12)
    at emitOne (events.js:116:13)
    at Socket.emit (events.js:211:7)
    at addChunk (_stream_readable.js:263:12)
    at readableAddChunk (_stream_readable.js:250:11)
    at Socket.Readable.push (_stream_readable.js:208:10)
    at TCP.onread (net.js:594:20)

I have queries that I want to always be streaming, but sometimes the submitted parameters limit the result set to only a few records

chriszrc avatar Feb 01 '18 02:02 chriszrc

Ok, turns out that was not the problem. There were some query calls where the parameters were wrong, and the query really was empty. Still, QueryStream should implement the handleEmptyQuery right?

chriszrc avatar Feb 01 '18 14:02 chriszrc