All posts
A ClickHouse® Database SQL Editor in Your Browser

A ClickHouse® Database SQL Editor in Your Browser

May 6, 20264 min readSanjeev Kumar G
Share:

I spent the first couple of years of my ClickHouse® career inside clickhouse-client. It is a fine tool. But when you are debugging something at 9am with three terminals open, copy-pasting results into a spreadsheet, and trying to remember the query you ran yesterday, the cracks show. A browser-based SQL editor fixes most of that, and it has changed how I work day to day.

This is a walk through what the CHOps SQL editor actually does and why each piece matters.

Why leave the terminal

The terminal is great for one query at a time. It is bad at everything around the query: keeping several investigations open, finding something you ran last week, sharing a result with a colleague, or formatting a wide result set so you can actually read it. You end up building a personal workflow out of shell history, tmux panes, and text files. It works, but only for you, and only until you forget which file had the good query.

A SQL editor in the browser keeps all of that in one place, and it does it the same way for everyone on the team.

Schema-aware autocomplete

The single feature I missed most from other tools was autocomplete that actually knows my database. Generic SQL autocomplete suggests keywords. A ClickHouse®-aware editor suggests your table names, your column names, the ClickHouse® functions, and it understands engine-specific syntax like FINAL, PREWHERE, and SAMPLE.

When I type a query now, it completes table and column names as I go:

SELECT
    user_id,
    countIf(event_type = 'purchase') AS purchases,
    sumIf(amount, event_type = 'purchase') AS revenue
FROM analytics.events
WHERE event_date >= today() - 7
GROUP BY user_id
ORDER BY revenue DESC
LIMIT 50;

I did not have to remember whether the column was event_type or eventType, or look up that countIf exists. The editor knew, because it read the schema from the cluster. That sounds small. Over a day of querying it is the difference between flow and constant context-switching.

Tabs for parallel work

Real debugging is never one query. You have the query that shows the symptom, the query that checks a theory, and the query that confirms the fix. In the editor each of those lives in its own tab, like a code editor. I keep one tab pinned to a system.query_log lookup, another to the table I am investigating, and a third for scratch work. Switching between them keeps the whole investigation in front of me.

Every query you run is saved. Not in your shell history on one machine, but in the editor, searchable. When someone asks "what was that query you used to find the duplicate rows," I search my history instead of trying to reconstruct it. For queries I run often, I bookmark them so they are one click away. I wrote more about history and bookmarks separately, because that feature alone saves me real time.

Exports without the copy-paste dance

Results come back in a proper table you can read, and when you need the data elsewhere you export it directly to CSV, JSON, or TSV. No selecting terminal output, no fighting with column alignment, no piping through sed. If an analyst needs the numbers in a spreadsheet, they click export. I covered the export formats in detail in another post.

The part that matters for teams

Here is the real win. When the SQL editor lives in a shared tool instead of each person's terminal, the whole team works the same way. Autocomplete means analysts do not need to memorize the schema. History means knowledge does not disappear when someone is on holiday. And nobody needs SSH access to a production node just to run a SELECT.

If you are still living in clickhouse-client, try moving one investigation into a browser editor and see how it feels. For me it was the change that made ClickHouse® feel like a database a team could operate, not just a binary one person ran. The SQL editor feature page has the full list of what it can do.

Share: