We give every user SQL access to a shared ClickHouse cluster

Trigger.dev adds safety layer; commenters yell 'just use Postgres' and 'let us chat with data'

TLDR: Trigger.dev built a SQL-like safety layer so anyone can query a shared database without leaking data. Commenters roasted it as wheel‑reinvention, arguing built‑in database security or simpler tools work fine, while some joked the future is “chat with your data”—a classic simplicity vs safety showdown that matters for every data team.

Trigger.dev dropped TRQL, a SQL‑style mini‑language that turns user queries into safe, tenant‑only requests on their shared ClickHouse setup. It bans dangerous commands, auto‑adds org filters so you can’t leak data, hides gnarly table names, and even adds extras like time bucketing. They credit PostHog’s HogQL for the spark. Sounds neat… until the comments arrived.

The crowd erupted into a “why reinvent the wheel?” brawl. The loudest chorus: you could do most of this with built‑in database features like row‑level security (RLS) and sane data design. One user bragged they give every employee SQL on their finance database using PostgreSQL RLS—“no drama, no new language.” Another pointed to MotherDuck/DuckDB: tenant isolation without teaching users a new syntax. A newcomer asked if ClickHouse even has a niche versus MySQL/Postgres, turning the thread into a side‑quest on when you need speed‑obsessed analytics engines.

Defenders say TRQL is safety by construction—you literally can’t write a bad query—and those virtual columns and auto bucketing are hard to get from raw SQL. But the meme of the day was classic: “just use Postgres.” Bonus hot take: the “final form” is AI—why write queries when you can “chat with the data”

Key Points

  • Trigger.dev created TRQL, a SQL-like DSL that compiles into secure, tenant-scoped ClickHouse queries for a shared analytics cluster.
  • The DSL’s grammar excludes dangerous operations (e.g., INSERT, UPDATE, DELETE, DROP) to enforce security by construction.
  • TRQL automatically injects tenant isolation filters and abstracts internal schema details from users.
  • TRQL adds features beyond ClickHouse, including virtual columns, automatic time bucketing, value transforms, and rendering metadata.
  • ClickHouse was selected for its columnar storage, performance at scale, rich SQL features, and proven use by major companies; ANTLR powers TRQL’s parser.

Hottest takes

"tradeoff a massive ecosystem for very little benefit" — senorrib
"We never bothered to complicate it like the post does" — zie
"chat with the data" — baalimago
Made with <3 by @siedrix and @shesho from CDMX. Powered by Forge&Hive.