Closed negreanucalin closed 1 year ago
Figured it out, here is my working code:
pool.connect(function (err: any, client: any, done: any) {
if (err) throw err
var stream = client.query(copyFrom('COPY pt.employee(name,lastname) FROM STDIN'))
for (var i = 1; i <= 5; i++) {
var line = ['test', '|', 'user', '\n'] // <- Used the default column delimiter ( | ) and new row delimiter ( \n )
stream.write(line.join(''))
console.log('Write: ' + line.join(''));
}
stream.end(); // Cleanup here because stream.on('end', ... ); does not get called
done();
})
P.S: with pg-copy-streams at 6.0.4
Hello, I am trying to insert multiple rows and am trying to do this using copy streams. I tried running a modified version of this integration test but there seem to be issues:
end
callback is not executed (works if downgrading pg-copy-streams to 0.3.0, from latest 6.0.4)P.S: Connection works (read/write)
Code:
Output
Versions: Vertica: Vertica Analytic Database v11.1.1-0 Node: v16.18.1