Skip to content

Commit 8bcd405

Browse files
antonbrianc
anton
authored andcommitted
make copy related events to have same names in native and libpq clients
1 parent 9828615 commit 8bcd405

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

lib/native/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,12 +193,12 @@ var clientBuilder = function(config) {
193193
connection._pulseQueryQueue();
194194
}
195195
});
196-
connection.on('_copyInResponse', function () {
196+
connection.on('copyInResponse', function () {
197197
//connection is ready to accept chunks
198198
//start to send data from stream
199199
connection._activeQuery.streamData(connection);
200200
});
201-
connection.on('_copyData', function (chunk) {
201+
connection.on('copyData', function (chunk) {
202202
//recieve chunk from connection
203203
//move it to stream
204204
connection._activeQuery.handleCopyFromChunk(chunk);

src/binding.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,7 @@ class Connection : public ObjectWrap {
439439
while ((result = PQgetResult(connection_))) {
440440
if (PGRES_COPY_IN == PQresultStatus(result)) {
441441
didHandleResult = false;
442-
Emit("_copyInResponse");
442+
Emit("copyInResponse");
443443
PQclear(result);
444444
break;
445445
} else if (PGRES_COPY_OUT == PQresultStatus(result)) {
@@ -483,7 +483,7 @@ class Connection : public ObjectWrap {
483483
if (copied > 0) {
484484
Buffer * chunk = Buffer::New(buffer, copied);
485485
Handle<Value> node_chunk = chunk->handle_;
486-
Emit("_copyData", &node_chunk);
486+
Emit("copyData", &node_chunk);
487487
PQfreemem(buffer);
488488
//result was not handled copmpletely
489489
return false;

0 commit comments

Comments
 (0)