1const stream = knex.select('*').from('users').stream();
2stream.on('data', function (row) {
3 console.log(row);
4})
5.on('error', function (error) {
6 console.log('error', error.message)
7})
8.on('end', function () {
9 console.log('end')
10})
11req.on('close', stream.close.bind(stream)); // manually close on request cancel
12// how can you stream to the socket?
13// how do you know when the amount is reached to end the response?
14});