ClickHouse / clickhouse-js

Official JS client for ClickHouse DB
https://clickhouse.com
Apache License 2.0
205 stars 25 forks source link

Design Bug: CLICKHOUSE_HOST is an incorrect variable name #231

Closed iMerica closed 5 months ago

iMerica commented 6 months ago

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

slvrtrn commented 6 months ago

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.