Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

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

Đang mở
#355 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
35/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Ít trao đổi
Công nghệ
sql, typescript

Hướng nghiên cứu

Bắt đầu với runQuery và đường dẫn yêu cầu /api/cluster/{id}/query, sau đó xem xét core/param-serialize.ts và occurrence scanner hiện có. Trước tiên, ghi lại liệu native forwarding có khả dụng hay không; nếu không, hãy triển khai strict renderer được chỉ định và kiểm tra checklist chấp nhận, bao gồm tính tương đương của kết quả, các kiểu và toTypeName() so với hành vi param_* native.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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().
Ngôn ngữ chính
TypeScript
Star
8
Fork
2
Merge trung bình
1 giờ 34 phút
Pull request đã merge (30 ngày)
6

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của Altinity/altinity-sql-browser

Tất cả issue của Altinity/altinity-sql-browser

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.