Part of #352. Native param_* are not forwarded by the proxy (verified UNKNOWN_QUERY_PARAMETER).
Preferred: forward params server-side (ACM-side ask)
Given tight ACM integration is a plus, the cleanest fix is to have /api/cluster/{id}/query accept a structured param map (and settings) and bind them natively in ClickHouse — no client-side SQL rewriting, full type parity. Raise with the ACM team first; if accepted, this issue reduces to wiring runQuery's params through the request body.
Fallback: strict client-side {name:Type} renderer
If native forwarding isn't available, render typed value placeholders {name:Type} (CH syntax) → SQL literals, typed values only, no free-form/identifier macros. Do not reuse core/param-serialize.ts (it targets the HTTP param_* channel: passes scalar strings raw, treats unknown types as opaque — not inline-SQL-safe or type-equivalent). Instead a separate strict renderTypedSqlExpression:
- explicit allowlist of supported type ASTs (reject unknown);
- parse compound values into structured values (never trust free-form strings);
- quote every textual component; emit explicit casts where CH semantics need them (e.g.
{x:UUID} → CAST('…' AS UUID), Date/DateTime64/Decimal/Enum/IPv4/6/large-int);
- reuse the existing occurrence scanner's exact spans (ignores placeholders in literals/comments); replace right-to-left.
Acceptance
Part of #352. Native
param_*are not forwarded by the proxy (verifiedUNKNOWN_QUERY_PARAMETER).Preferred: forward params server-side (ACM-side ask)
Given tight ACM integration is a plus, the cleanest fix is to have
/api/cluster/{id}/queryaccept a structured param map (and settings) and bind them natively in ClickHouse — no client-side SQL rewriting, full type parity. Raise with the ACM team first; if accepted, this issue reduces to wiringrunQuery's params through the request body.Fallback: strict client-side
{name:Type}rendererIf native forwarding isn't available, render typed value placeholders
{name:Type}(CH syntax) → SQL literals, typed values only, no free-form/identifier macros. Do not reusecore/param-serialize.ts(it targets the HTTPparam_*channel: passes scalar strings raw, treats unknown types as opaque — not inline-SQL-safe or type-equivalent). Instead a separate strictrenderTypedSqlExpression:{x:UUID}→CAST('…' AS UUID), Date/DateTime64/Decimal/Enum/IPv4/6/large-int);Acceptance
CASTwhere needed; unsupported values fail closed.param_*(public build) vs. this path → identical results, types, andtoTypeName().