Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

connect to clickhouse over http from cmdline #463

Closed
tarasglek opened this issue May 11, 2024 · 4 comments
Closed

connect to clickhouse over http from cmdline #463

tarasglek opened this issue May 11, 2024 · 4 comments

Comments

@tarasglek
Copy link

tarasglek commented May 11, 2024

Hi, the clickhouse driver supports native and http. I can't figure out how to connect to clickhouse over http using usql.

The following works inside usql

\c clickhouse https://user:pass@host/db?secure

Why I can't a pass this as a param on cmdline?

usql clickhouse:https://user:pass@host/db?secure
error: clickhouse: dial tcp: lookup https: no such host

or

usql clickhouse+https://user:pass@host/db?secure
error: invalid transport protocol

Neither works. Where am I getting the syntax wrong?

@kenshaw
Copy link
Member

kenshaw commented May 11, 2024

I've read the Clickhouse driver code, this needs to be added via dburl generating the schema with a +http and +https scheme. Alternately, could use completely different schemes. I'll look into this and try to get an implementation out in the next few hours.

@kenshaw
Copy link
Member

kenshaw commented May 11, 2024

Pushing a release now -- Clickhouse URLs should now support clickhouse+http and clickhouse+https. I have not thoroughly vetted this, please provide feedback if this meets your expectations.

@kenshaw
Copy link
Member

kenshaw commented May 11, 2024

@tarasglek I was just rereading your original comment. The commit I pushed adds support for clickhouse+http:// and clickhouse+https:// as URL schemes, however it's worth noting that \c clickhouse https://user:pass@host/db?secure should have been able to connect.

I would assume if it failed, you were on an older version of usql -- if so, could you share what version of usql you encountered this with?

Regardless, as soon as the builds have finished, I'll set the release and when you update to the latest v0.19.1 version of usql, all of the URL forms you shared above should work. If they don't, please open a new issue and I'll debug further.

@tarasglek
Copy link
Author

tarasglek commented May 12, 2024

Wow, thanks for quick turn-around, I wish I reported this earlier :) Verified that the clickhouse+ way works as one would expect!

\c clickhouse https://user:pass@host/db?secure did work, sorry if i wasn't clear.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants