Streaming now use async iterators instread of Node.js streams internally. External API returns stream, as before
Pooling moved completely to client library. generic-pool is not used at all, dbMaxPoolSize is passed to client library to limit open sockets. New client maintains http.Agent internally, and have it's own idle timers, looks fine for us.
Queries now does not send session_id, as we anyway expect queries to be independent, and don't use session-bound stuff, like temporary tables. Previous behaviour was kind of weird: session ids were attached to client in pool, but for every query it would pull acquire new client from pool, so nothing could actually utilize same session.
KILL QUERY on cancellation now uses separate client instance, to avoid getting stuck on busy pool
query method supports only SELECT queries, or other queries that return result sets. For DDL queries on this client library one have to use other methods. Because of that more overrides were necessary, like dropTable, createSchemaIfNotExists or createTable.
Driver now respects per-datasource dbQueryTimeout config
Check List
Description of Changes Made (if issue reference is not provided)
Switch client library used to talk to ClickHouse to upstream one. Lots of related changes:
meta
field in JSON format. Instread it relies onJSONCompactEachRowWithNamesAndTypes
: first two rows returned should contain names and types. https://clickhouse.com/docs/en/sql-reference/formats#jsoncompacteachrowwithnamesandtypesgeneric-pool
is not used at all,dbMaxPoolSize
is passed to client library to limit open sockets. New client maintainshttp.Agent
internally, and have it's own idle timers, looks fine for us.session_id
, as we anyway expect queries to be independent, and don't use session-bound stuff, like temporary tables. Previous behaviour was kind of weird: session ids were attached to client in pool, but for every query it would pull acquire new client from pool, so nothing could actually utilize same session.KILL QUERY
on cancellation now uses separate client instance, to avoid getting stuck on busy poolquery
method supports onlySELECT
queries, or other queries that return result sets. For DDL queries on this client library one have to use other methods. Because of that more overrides were necessary, likedropTable
,createSchemaIfNotExists
orcreateTable
.dbQueryTimeout
config