ClickHouse / ClickHouse/clickhouse-go

Support connection option for quota key

Open
#944 4 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Go
Stars
3.3k
Forks
680
Avg merge
2d 3h
Merged PRs (30d)
14

Description

**Is your feature request related to a problem? Please describe.**
`clickhouse.WithQuotaKey` actually not working. According to https://github.com/ClickHouse/clickhouse-go/blob/v2.8.0/conn_handshake.go#L86-L88 it's possible to set quota key in connection level. There is some work need to be done.

**Describe the solution you'd like**
Maybe `clickhouse.Option` can provide an entry for user to set quota key.

**Describe alternatives you've considered**
It's better that the server side supports query quota key.But According to https://github.com/ClickHouse/ClickHouse/pull/39874#issuecomment-1204577354, this feature seems need to be done.

**Additional context**
Btw,[ document on official website](https://clickhouse.com/docs/en/integrations/go#using-context) about setting quota key through context is confusing.As for now, it's not working as expected.

Contributor guide

Open the contributing guide

Research direction

Start with conn_handshake.go lines 86-88 and trace how clickhouse.Option values are passed into connection setup. Compare that path with the documented context-based quota-key behavior and the existing WithQuotaKey handling. Done means a connection-level option can set the quota key as requested and the behavior is covered by the project’s relevant tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
databases
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.