Skip to content

Commit

Permalink
remove query.stream references
Browse files Browse the repository at this point in the history
* This hasn't been supported since 0b2344b
* `node-pg-copy-streams` relies on overriding the `handleCopyInResponse` method:
  * https://github.com/brianc/node-pg-copy-streams/blob/e15feb19/index.js#L53
  • Loading branch information
tlhunter authored and brianc committed Oct 3, 2018
1 parent 11a4793 commit fed6375
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions lib/query.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ var Query = function (config, values, callback) {
this.types = config.types
this.name = config.name
this.binary = config.binary
this.stream = config.stream
// use unique portal name each time
this.portal = config.portal || ''
this.callback = config.callback
Expand Down Expand Up @@ -216,17 +215,10 @@ Query.prototype.prepare = function (connection) {
}

Query.prototype.handleCopyInResponse = function (connection) {
if (this.stream) this.stream.startStreamingToConnection(connection)
else connection.sendCopyFail('No source stream defined')
connection.sendCopyFail('No source stream defined')
}

Query.prototype.handleCopyData = function (msg, connection) {
var chunk = msg.chunk
if (this.stream) {
this.stream.handleChunk(chunk)
}
// if there are no stream (for example when copy to query was sent by
// query method instead of copyTo) error will be handled
// on copyOutResponse event, so silently ignore this error here
// noop
}
module.exports = Query

0 comments on commit fed6375

Please sign in to comment.