make copy related events to have same names in native and libpq clients

This commit is contained in:
anton 2012-11-06 16:55:43 +02:00 committed by brianc
parent 98286152dd
commit 8bcd40595d
2 changed files with 4 additions and 4 deletions

View File

@ -193,12 +193,12 @@ var clientBuilder = function(config) {
connection._pulseQueryQueue();
}
});
connection.on('_copyInResponse', function () {
connection.on('copyInResponse', function () {
//connection is ready to accept chunks
//start to send data from stream
connection._activeQuery.streamData(connection);
});
connection.on('_copyData', function (chunk) {
connection.on('copyData', function (chunk) {
//recieve chunk from connection
//move it to stream
connection._activeQuery.handleCopyFromChunk(chunk);

View File

@ -439,7 +439,7 @@ protected:
while ((result = PQgetResult(connection_))) {
if (PGRES_COPY_IN == PQresultStatus(result)) {
didHandleResult = false;
Emit("_copyInResponse");
Emit("copyInResponse");
PQclear(result);
break;
} else if (PGRES_COPY_OUT == PQresultStatus(result)) {
@ -483,7 +483,7 @@ protected:
if (copied > 0) {
Buffer * chunk = Buffer::New(buffer, copied);
Handle<Value> node_chunk = chunk->handle_;
Emit("_copyData", &node_chunk);
Emit("copyData", &node_chunk);
PQfreemem(buffer);
//result was not handled copmpletely
return false;