apla / node-clickhouse

Yandex ClickHouse driver for nodejs
MIT License
217 stars 50 forks source link

connect/disconnect or how to know if connection is alive #68

Closed murashki closed 3 years ago

murashki commented 3 years ago

Should I create ch on every query or can use instance of ch in time?

const ch = new ClickHouse({ host: HOST, post: PORT, user: USER, password: PASSWORD });

If i shouldn't, how can i know if connection is alive and how to disconnect from CH?

murashki commented 3 years ago

Sorry. I should take a look in source code.

Every query - it's just a http request to remote DB server with options supplied on ch creation. So we don't know how it feels. ping or next query will give us an answer.