Fixes pipe from a file to table example in README.md.
This commit is contained in:
parent
25b8d6da5f
commit
107f007249
@ -39,9 +39,8 @@ var copyFrom = require('pg-copy-streams').from;
|
||||
pg.connect(function(err, client, done) {
|
||||
var stream = client.query(copyFrom('COPY my_table FROM STDIN'));
|
||||
var fileStream = fs.createReadStream('some_file.tdv')
|
||||
fileStream.pipe(stream);
|
||||
fileStream.on('end', done);
|
||||
fileStream.on('error', done);
|
||||
fileStream.pipe(stream).on('finish', done).on('error', done);
|
||||
});
|
||||
```
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user