#1669

[Feature]: Add ClickHouse support

Openqwerty1q2wopened 2mo ago

Is your feature request related to a problem?

hoop.dev does not support ClickHouse. Currently, this only works with an ancient version (0.6.3) of the driver via an HTTP proxy. The old version of the driver allows you to omit the username and password.

Describe the solution you'd like

Connections to ClickHouse via hoop.dev from DBeaver and DataGrip. We would like to have the same way like for PostgreSQL or MySQL hoop connect clikhouseDB and than we expect address port user password.

Describe alternatives you've considered

No response

Priority

High - Critical for my use case

Use Case

ClickHouse is one of the most widely used analytical databases, and many BI and data teams work with it daily. They often use tools such DBeaver, DataGrip, other IDE.

Mockups or Examples

No response

Additional Context

No response

Contribution

  • I would be willing to submit a PR to implement this feature

Code of Conduct

  • I agree to follow this project's Code of Conduct

Activity

3
github-actions[bot]2mo ago

🔗 Synced to Linear: SUP-187

jackoberman2mo ago

We've been using ClickHouse through hoop in production and have two patterns working well — sharing in case it's useful to others while native support is considered.

Exec connection (interactive shell / one-shot queries)

Our setup uses a custom agent image built on hoophq/hoopdev with clickhouse-client added. Our admin created the connection like this:

hoop admin create conn clickhouse-exec \
  -a default \
  -e CH_HOST=<nlb-hostname> \
  -e CH_USER=<ch_user> \
  -e CH_PASSWORD=<password> \
  -- clickhouse-client \
       --host '$CH_HOST' \
       --port 9000 \
       --user '$CH_USER' \
       --password '$CH_PASSWORD'

From the user side, hoop connect clickhouse-exec drops into a live clickhouse-client shell. One-shot queries work via:

hoop connect clickhouse-exec -- --query "SELECT count() FROM my_table"

HTTP proxy connection (DBeaver / DataGrip / clickhouse-connect)

For GUI tools, our admin set up an application/httpproxy connection that tunnels ClickHouse's HTTP interface (port 8123) with credentials injected as headers:

hoop admin create conn clickhouse-http \
  -a default \
  -t application/httpproxy \
  -e REMOTE_URL=http://<clickhouse-host>:8123 \
  -e HEADER_X-ClickHouse-User=<ch_user> \
  -e HEADER_X-ClickHouse-Key=<password>

From the user side, hoop connect clickhouse-http opens a local proxy at 127.0.0.1:8081. You then point DBeaver/DataGrip at localhost:8081 using the ClickHouse HTTP driver — no credentials needed in the IDE.

One caveat with /play UI

The ClickHouse /play UI appends ?user=&password= query params on every request, which conflicts with hoop's injected X-ClickHouse-User/Key headers — ClickHouse rejects requests with both. Our admin worked around it with a small proxy that strips the query params and injects Basic auth instead. Happy to share more detail on that if useful.

The HTTP proxy approach covers the DBeaver/DataGrip use case well in the meantime. Would love to see a first-class ClickHouse connection type eventually!

qwerty1q2w2mo ago

Thanks! I probably found the new way for DBeaver and probably DataGrip. I set No authentication in Driver Settings and use this URL jdbc:clickhouse://localhost:8081/default?http_use_basic_auth=false