mirror of
https://github.com/brianc/node-postgres.git
synced 2025-12-08 20:16:25 +00:00
make copy related events to have same names in native and libpq clients
This commit is contained in:
parent
98286152dd
commit
8bcd40595d
@ -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);
|
||||
|
||||
@ -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;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user