ClickHouse / ClickHouse/clickhouse-rs
Move query URI `param_*` bind values to the POST body
- Dominant language
- Rust
- Stars
- 559
- Forks
- 173
- Avg merge
- 1d 19h
- Merged PRs (30d)
- 3
Description
### Use case
I am running into the "Query URI too long" problem. I initially thought that this was because the query was being fully sent in the URI and I wanted to switch to sending in the POST body, but I discovered that the query is already being sent in the POST body. What's hitting me is that I am reaching the URI limit due only to `param_*` bind values which are (according to my ai) still being sent in the URI. Apparently it would be possible to move the bind values also out of the URI and into the POST body.
I am the maintainer of [diesel_clickhouse](https://github.com/cjrh/diesel-clickhouse), so the interface I am presenting to clients is a diesel ORM one, not a pure clickhouse one. So this issue is difficult for me to fix and my clients are dropping back to raw SQL (with literal params instead of binds) in such cases.
### Describe the solution you'd like
If possible, move the `param_*` bind values out of the URI and into the POST body. This would avoid the length limits on the URI.
### Describe the alternatives you've considered
For myself, I considered doing chunked requests inside diesel_clickhouse automatically. But this doesn't work for aggregations and other functions that must consider the whole body of matched documents per query. So chunking won't work as a general solution.
### Additional context
I am more than happy to help contribute to move this along. I can do reviews, testing, and I could attempt a PR if you prefer that.
Contributor guide
Research direction
Start by tracing how ClickHouse HTTP requests construct the query URI and POST body, focusing on the `param_*` bind values described in the issue. Verify the current request behavior and identify the request and test entry points before changing it; done means bind values no longer contribute to URI length while queries still execute correctly.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- clickhouse, rust
- Domain
- backend, databases
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100