[sup] Parameters: forward natively server-side, else strict {name:Type} renderer + parity test

オープン
#355 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
35/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
静か
技術スタック
sql, typescript

調査の方向性

runQuery と /api/cluster/{id}/query リクエストパスから始め、次に core/param-serialize.ts と既存の occurrence scanner を確認します。まず native forwarding が利用可能かどうかを記録してください。利用できない場合は、指定された strict renderer を実装し、結果、型、および toTypeName() が native param_* の動作と一致することを含め、受け入れチェックリストを検証してください。

索引モデルが issue の本文から書いたものです。

説明

enhancement sup

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:

  1. explicit allowlist of supported type ASTs (reject unknown);
  2. parse compound values into structured values (never trust free-form strings);
  3. 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);
  4. reuse the existing occurrence scanner's exact spans (ignores placeholders in literals/comments); replace right-to-left.

Acceptance

  • Decision recorded: native forwarding vs. client renderer.
  • If renderer: allowlisted types render + CAST where needed; unsupported values fail closed.
  • Parity test: same query+values via native param_* (public build) vs. this path → identical results, types, and toTypeName().
主要言語
TypeScript
スター
8
フォーク
2
平均マージ
1時間 34分
マージ済み PR(30日)
6

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

Altinity/altinity-sql-browser のほかの issue

Altinity/altinity-sql-browser の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。