feat(clickhouse-driver): Switch from apla-clickhouse to @clickhouse/client #8928
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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