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

Usability improvement for selects with ch-go #1042

Open
nikita-vanyasin opened this issue Feb 13, 2025 · 1 comment
Open

Usability improvement for selects with ch-go #1042

nikita-vanyasin opened this issue Feb 13, 2025 · 1 comment
Assignees
Labels
enhancement New feature or request question Further information is requested

Comments

@nikita-vanyasin
Copy link
Member

nikita-vanyasin commented Feb 13, 2025

Hello!

some time ago, I've switched one of my applications from clickhouse-go to ch-go.
It turned out, writing the code for select queries is not quite easy, especially I was not able to find a good example of handling such query.

After some experiments I came up with working code, but it was not quite readable and human-friendly.

So I've created a small helper library to make the process a bit more fancy while not losing performance.

Please take a look:

Do you think it is worth including as part of ch-go package? I can prepare a PR 👌🏻

@SpencerTorres SpencerTorres self-assigned this Feb 13, 2025
@SpencerTorres
Copy link
Member

Copying my Slack response here:

Hey thanks for making this and writing a blog post, it's good to get more content out there about these lower level drivers.

Part of your description says this:

a bit more fancy while not losing performance

I would like to know exactly how much overhead it really adds. I'm sure it's very little, but with ch-go every cycle and allocation counts. As (relatively) ugly as the SELECT queries are, they are as minimal as can be. In your blog post you mention a scenario where having 30+ high performance ch-go queries would be hard to maintain, but if the queries were important enough to require ch-go then I think they would be maintained well enough to not require such a wrapper.

I'm cautious about adding (and maintaining) another usage pattern to the driver itself, since I think it would lead to even more confusion from the users as to what the preferred implementation is. However, I think it would be fair to perhaps link to your module in the README as an optional layer of abstraction that the user can choose to use.

The clickhouse-go module should ideally be this thin wrapper, but we trade performance for convenience there

@SpencerTorres SpencerTorres added enhancement New feature or request question Further information is requested labels Feb 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants