ClickHouse/clickhouse-js

Design Bug: CLICKHOUSE_HOST is an incorrect variable name

iMerica opened this issue · 1 comments

See RFC-1738

Hi there,

Thank you for building this library. This is just a quick bug report that CLICKHOUSE_HOST is a poorly named variable name. The host and hostname of a URL are very clear and unambiguous concepts. They typically refer only to the host where a server can be resolved. Not to the entire URI. If you want the entire URI, then call the variable CLICKHOUSE_URI or better yet call it CLICKHOUSE_URL and accept a connection string.

See the host in the URL api of Javascript

new URL("https://github.com").host
'github.com'

Also look how PostgreSQL uses the noun "host" to only refer to the hostname

https://www.postgresql.org/docs/6.4/jdbc19100.htm

CLICKHOUSE_HOST is not used in the code; it's from the examples, right?
Minimal URL support will be added soon in the scope of #228, and the host client configuration parameter will be deprecated.