ClickHouse / ClickHouse/clickhouse-connect

Support Custom Query Type Format

Open
#429 4 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Python
Stars
521
Forks
159
Avg merge
1d 7h
Merged PRs (30d)
46

Description

**Is your feature request related to a problem? Please describe.**
I'm trying to integrate 3rd party types into clickhouse-connect. For example, `whenever.Instant`
I found them useful here:
https://clickhouse.com/docs/en/integrations/python#write-formats
https://clickhouse.com/docs/en/integrations/python#read-formats
The write-format could be related, but I found the query string formatting is its own function and rather limited.

**Describe the solution you'd like**
It would be best to add set_query_format, and refers to it when constructing query SQL.

**Describe alternatives you've considered**
I tried monkey-patching. I did patching format_bind_value and format_query_value. but the meanings of them are unclear.

Contributor guide

Open the contributing guide

Research direction

Start by tracing how format_bind_value and format_query_value are used when constructing query SQL, since the issue identifies them as the current formatting points. Determine how a set_query_format API should integrate with that path, then verify that third-party types such as whenever.Instant can use custom query formatting without breaking existing queries.

Written by the indexing model from the issue text.

Assessment

Tech stack
clickhouse, python
Domain
backend-api-design, databases
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.