function Runner_PG() {
this.client = client;
Runner.apply(this, arguments);
}
inherits(Runner_PG, Runner);
var PGQueryStream;
Runner_PG.prototype._stream = Promise.method(function(sql, stream, options) {
PGQueryStream = PGQueryStream || require('pg-query-stream');
var runner = this;
return new Promise(function(resolver, rejecter) {
stream.on('error', rejecter);
stream.on('end', resolver);
runner.connection.query(new PGQueryStream(sql.sql, sql.bindings, options)).pipe(stream);
});
});
Inherit from the
Runnerconstructor's prototype, so we can add the correctthenmethod.