PostHog / node-clickhouse

ClickHouse driver for Node.js
MIT License
6 stars 1 forks source link

Does not write before `insertStream.end()` is called #3

Open gajus opened 2 years ago

gajus commented 2 years ago
const insertStream = clickHouse.query('INSERT INTO log_event', {
  format: 'JSONEachRow',
});

insertStream.write({
    message,
});

setTimeout(() => {
  insertStream.end();
}, 1000);

In the above example, nothing will get written until before insertStream.end() is called.

I was expecting that I can just open the query and continue writing for as long as I want, but eventually a timeout error is raised.