You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[client-v2, jdbc-v2] Server bound query parameters #2827
clientModule: the client (client-v2; with legacy: the v1 client)enhancementjdbcModule: the JDBC driver (jdbc-v2; with legacy: the v1 driver)queriesArea: how the client builds and runs statements (parameters, quoting, batches)
Effort to Fix: Medium Type: Feature Request / Enhancement Affected Module: client-api-v2, jdbc-v2
Summary
The client-v2 module has minimal server-side query parameter support (Client.query(sql, Map<String,Object>)) but the encoding is naive (String.valueOf(v)) with no type-aware conversion or proper ClickHouse escaping. The jdbc-v2 PreparedStatementImpl uses client-side ?-placeholder substitution and has no path to use ClickHouse's server-bound named parameters; this support existed in jdbc-v1 via useNamedParameter with :name(Type) syntax and needs to be ported to v2.
Should jdbc-v2 PreparedStatement route all parameterized queries to server-side named params, or only opt-in via a connection property (mirroring the v1 use_named_parameter flag)?
What ClickHouse data types need first-class encoding support in the parameter serializer (e.g. DateTime64, Array, Tuple, Nullable, UUID)?
Are there known server-version constraints — i.e., is there a minimum ClickHouse server version that reliably supports all the required param_* query-string features?
Should the value-converter/encoder live inside client-v2 (shared) or be duplicated per module?
Tests to Add
Test 1: Type-aware parameter encoding in client-v2
Recommendation: Keep open — maintainer decision
The client-v2 part is mostly on main; jdbc-v2 still has no server-bound parameters. Decide whether jdbc-v2 PreparedStatement sends its values as param_<name> by default or only behind an option.
Status on main: Not supported on main — code read on 8480ca001: client-v2 sends typed param_<name> values; jdbc-v2 PreparedStatement writes the ? values into the SQL text.
Breaking change: No — can be done without a break, if server-bound parameters in jdbc-v2 are opt-in.
Analysis:Client.query(sql, params) converts each value to its param_<name> text in DataTypeConverter.convertParameterToString (client-v2/src/main/java/com/clickhouse/client/api/internal/DataTypeConverter.java:269, called at Client.java:2009), with escaping, quoted container elements, and \N for null (#2962, #2898, #2981); the docs have an example (docs/clickhouse-docs/client.mdx:792). jdbc-v2 renders the values into the SQL on the client (docs/features.md:112) and has no path to {name:Type} parameters.
Automated triage by Polyglot AI. A maintainer makes the final decision.
clientModule: the client (client-v2; with legacy: the v1 client)enhancementjdbcModule: the JDBC driver (jdbc-v2; with legacy: the v1 driver)queriesArea: how the client builds and runs statements (parameters, quoting, batches)
Activity
DESCRIBE TABLEquery with client-v2 #2400List<String>as a query parameter in client-v2 requires to single quote every element #2407github-actions commentedon Jun 16, 2026
Triage Report
Effort to Fix: Medium
Type: Feature Request / Enhancement
Affected Module: client-api-v2, jdbc-v2
Summary
The client-v2 module has minimal server-side query parameter support (
Client.query(sql, Map<String,Object>)) but the encoding is naive (String.valueOf(v)) with no type-aware conversion or proper ClickHouse escaping. The jdbc-v2PreparedStatementImpluses client-side?-placeholder substitution and has no path to use ClickHouse's server-bound named parameters; this support existed in jdbc-v1 viauseNamedParameterwith:name(Type)syntax and needs to be ported to v2.Recommended Labels & Priority
Missing Information / Questions for User
PreparedStatementroute all parameterized queries to server-side named params, or only opt-in via a connection property (mirroring the v1use_named_parameterflag)?DateTime64,Array,Tuple,Nullable,UUID)?param_*query-string features?client-v2(shared) or be duplicated per module?Tests to Add
Test 1: Type-aware parameter encoding in client-v2
Test 2: jdbc-v2 PreparedStatement with server-bound named parameters
polyglotAI-bot commentedon Nov 27, 2026
Recommendation: Keep open — maintainer decision
The client-v2 part is mostly on
main; jdbc-v2 still has no server-bound parameters. Decide whether jdbc-v2PreparedStatementsends its values asparam_<name>by default or only behind an option.main: Not supported on main — code read on8480ca001: client-v2 sends typedparam_<name>values; jdbc-v2PreparedStatementwrites the?values into the SQL text.Tupleparameter is sent as aMaporArrayliteral), [client-v2] Default sends query parameters in URI, causing HTTP 414 for large IN-lists / vector embeddings #2856 (parameters in the URL give HTTP 414).Analysis:
Client.query(sql, params)converts each value to itsparam_<name>text inDataTypeConverter.convertParameterToString(client-v2/src/main/java/com/clickhouse/client/api/internal/DataTypeConverter.java:269, called atClient.java:2009), with escaping, quoted container elements, and\Nfornull(#2962, #2898, #2981); the docs have an example (docs/clickhouse-docs/client.mdx:792). jdbc-v2 renders the values into the SQL on the client (docs/features.md:112) and has no path to{name:Type}parameters.Automated triage by Polyglot AI. A maintainer makes the final decision.