ClickHouse / ClickHouse/clickhouse-rs
Automatically set `query_id`
- Dominant language
- Rust
- Stars
- 559
- Forks
- 172
- Avg merge
- 1d 19h
- Merged PRs (30d)
- 3
Description
### Use case
ClickHouse supports the `replace_running_query` feature: https://clickhouse.com/docs/operations/settings/settings#replace_running_query
`query_id` can be set manually via `with_option()`, but we should be setting this automatically.
### Describe the solution you'd like
* `Query::get_query_id()`
* If `query_id` is not previously set, generate and store a query ID to return it? E.g. using `OnceLock`?
* `Query::with_query_id()`
* Like other explicit setters, easier to discover and use than `with_option()`.
Questions:
- [ ] Should `Insert` and `Inserter` gain this as well?
### Describe the alternatives you've considered
### Additional context
1.0 wishlist: feature parity
Contributor guide
Research direction
Start by locating Query's existing with_option implementation and any current query_id handling. Compare the proposed get_query_id and with_query_id behavior with the existing explicit setters, then determine whether Insert and Inserter should support the same API. Done means an unset query receives a stored generated ID, explicit IDs remain usable, and the chosen scope is covered by tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- clickhouse, rust
- Domain
- databases
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100