mirror of
https://github.com/knex/knex.git
synced 2025-10-06 13:35:49 +00:00

Only left alone ones in `test/tape/transactions.js` which would just cause unnecessary conflicts and get cleaned up by separate pull request #1257 anyway.
23 lines
536 B
JavaScript
23 lines
536 B
JavaScript
'use strict';
|
|
|
|
var tape = require('tape')
|
|
var stream = require('readable-stream')
|
|
|
|
module.exports = function(knex) {
|
|
|
|
if (knex.client.driverName === 'pg') {
|
|
tape('it streams properly in postgres', function(t) {
|
|
var w = new stream.Writable({
|
|
objectMode: true
|
|
})
|
|
w._write = function(chunk, _, next) {
|
|
setTimeout(next, 10);
|
|
}
|
|
knex.raw('select * from generate_series(0, 10, 1)').pipe(w).on('finish', function () {
|
|
console.log('finished');
|
|
t.end()
|
|
});
|
|
})
|
|
}
|
|
|
|
} |