@@ -266,31 +266,40 @@ class Connection : public ObjectWrap {
266
266
267
267
int Send (const char *queryText)
268
268
{
269
- return PQsendQuery (connection_, queryText);
269
+ int rv = PQsendQuery (connection_, queryText);
270
+ StartWrite ();
271
+ return rv;
270
272
}
271
273
272
274
int SendQueryParams (const char *command, const int nParams, const char * const *paramValues)
273
275
{
274
- return PQsendQueryParams (connection_, command, nParams, NULL , paramValues, NULL , NULL , 0 );
276
+ int rv = PQsendQueryParams (connection_, command, nParams, NULL , paramValues, NULL , NULL , 0 );
277
+ StartWrite ();
278
+ return rv;
275
279
}
276
280
277
281
int SendPrepare (const char *name, const char *command, const int nParams)
278
282
{
279
- return PQsendPrepare (connection_, name, command, nParams, NULL );
283
+ int rv = PQsendPrepare (connection_, name, command, nParams, NULL );
284
+ StartWrite ();
285
+ return rv;
280
286
}
281
287
282
288
int SendPreparedQuery (const char *name, int nParams, const char * const *paramValues)
283
289
{
284
- return PQsendQueryPrepared (connection_, name, nParams, paramValues, NULL , NULL , 0 );
290
+ int rv = PQsendQueryPrepared (connection_, name, nParams, paramValues, NULL , NULL , 0 );
291
+ StartWrite ();
292
+ return rv;
285
293
}
286
294
287
295
int Cancel ()
288
296
{
289
- PGcancel* pgCancel = PQgetCancel (connection_);
290
- char errbuf[256 ];
291
- int result = PQcancel (pgCancel, errbuf, 256 );
292
- PQfreeCancel (pgCancel);
293
- return result;
297
+ PGcancel* pgCancel = PQgetCancel (connection_);
298
+ char errbuf[256 ];
299
+ int result = PQcancel (pgCancel, errbuf, 256 );
300
+ StartWrite ();
301
+ PQfreeCancel (pgCancel);
302
+ return result;
294
303
}
295
304
296
305
// flushes socket
0 commit comments