0

Is there any convenient way to pipe a NodeJS stream into a RethinkDB table?

I'm thinking something similar to this for PostgreSQL:

pg.connect(function(err, client, done) {
  var stream = client.query(copyFrom('COPY my_table FROM STDIN'));
  var fileStream = fs.createReadStream('some_file.csv')
  fileStream.pipe(stream).on('finish', done);
});

Imagine you have large amounts of data and want to pipe it to a RethinkDB database using streams, what's the best way to do it?

Thanks!

Pensierinmusica
  • 6,404
  • 9
  • 40
  • 58

1 Answers1

3

You might want to check out the third-party driver RethinkDB Dash which has writeable streams. The official driver doesn't implement the stream interface currently, but we may be doing it in the near future

deontologician
  • 2,764
  • 1
  • 21
  • 33
  • 2
    I just added an example doing import/export with streams in case you're interested in a snippet -- https://github.com/neumino/rethinkdbdash-examples/tree/master/import-export – neumino Feb 15 '15 at 23:38