Skip to content

Commit fed6375

Browse files
tlhunterbrianc
authored andcommitted
remove query.stream references
* 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
1 parent 11a4793 commit fed6375

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

lib/query.js

+2-10
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ var Query = function (config, values, callback) {
2525
this.types = config.types
2626
this.name = config.name
2727
this.binary = config.binary
28-
this.stream = config.stream
2928
// use unique portal name each time
3029
this.portal = config.portal || ''
3130
this.callback = config.callback
@@ -216,17 +215,10 @@ Query.prototype.prepare = function (connection) {
216215
}
217216

218217
Query.prototype.handleCopyInResponse = function (connection) {
219-
if (this.stream) this.stream.startStreamingToConnection(connection)
220-
else connection.sendCopyFail('No source stream defined')
218+
connection.sendCopyFail('No source stream defined')
221219
}
222220

223221
Query.prototype.handleCopyData = function (msg, connection) {
224-
var chunk = msg.chunk
225-
if (this.stream) {
226-
this.stream.handleChunk(chunk)
227-
}
228-
// if there are no stream (for example when copy to query was sent by
229-
// query method instead of copyTo) error will be handled
230-
// on copyOutResponse event, so silently ignore this error here
222+
// noop
231223
}
232224
module.exports = Query

0 commit comments

Comments
 (0)