Documentation
¶
Overview ¶
Package sqlproxy serves GET/POST /v0/sql — a read-only ClickHouse SQL proxy. It does NOT parse SQL to enforce read-only; it forwards the query with a readonly profile + resource caps and lets ClickHouse refuse writes/DDL structurally (ADR 0011). Errors map to the shared Tinybird envelope, passing the ClickHouse exception code through X-DB-Exception-Code (ADR 0012).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func New ¶
New returns the /v0/sql handler. q runs the query over ClickHouse HTTP.
ponytail: MVP enforces read-only by sending readonly=2 as a per-query setting. Production should point q at a dedicated CH user whose profile pins readonly=2 server-side, so a settings injection in the query text can't unset it (ADR 0011 — "two ClickHouse identities").