mirror of
https://github.com/brianc/node-postgres.git
synced 2025-12-08 20:16:25 +00:00
remove query.stream references
* This hasn't been supported since 0b2344b6b5afbb68e89eff1ef2b57ecf0726d80b * `node-pg-copy-streams` relies on overriding the `handleCopyInResponse` method: * https://github.com/brianc/node-pg-copy-streams/blob/e15feb19/index.js#L53
This commit is contained in:
parent
11a4793452
commit
fed6375e0a
12
lib/query.js
12
lib/query.js
@ -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
|
||||
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user