Skip to content

ClickHouse

KryoDesk talks to ClickHouse over its HTTP interface (HTTPS port 8443, plain HTTP 8123; not the native protocol on 9000). A connection is read-only: browsing, quick search, structure with partitions, and the query editor. Every request, also the ones at login, is printed in the console of the connection tab with its query id, HTTP status, exception code, raw error text, rows and bytes read, and time.

Sessions → New session → Databases, arrow of the tile → ClickHouse (port 8443).

Field Values Default What it does
Specify username ClickHouse user Empty = asked; empty answer = default Sent in X-ClickHouse-User.
Encryption HTTPS (8443), Plain HTTP (8123) HTTPS Switching moves a default port with it. Plain HTTP sends queries, data and the password unencrypted.
Database Name; empty = the user’s default Empty database of every request (the editor’s database overrides it). A name that does not exist fails the login with code 81.

The password is kept in the vault as password:clickhouse://user@host:port and sent in the X-ClickHouse-Key header, never in the URL. Without a saved password the first attempt goes without one (default often has none); codes 192, 193, 194 and 516 ask for it (3 attempts). A password, saved or typed, goes over plain HTTP only after a [y/N] question. A login or password outside ASCII is sent as its UTF-8 bytes; control characters are refused.

The app lock wipes the password from the tab’s memory (it travels with every request). After the unlock it is read again from the vault when the tab logged in with the saved one or saved the typed one; otherwise the console command password asks for it. A request while locked is not sent (app locked: … in the console).

  1. DNS (addresses logged), then GET /ping without credentials: the TLS decision.
  2. TLS: a pinned certificate first, then the system’s trust for the host name. A certificate the system does not trust is read by a separate handshake (nothing else is sent), shown with SHA-256, subject, SAN, issuer and dates, and pinned in clickhouse_known_hosts.json only after Trust this certificate …? [y/N]. A pinned host accepts only that certificate; a different one is CERTIFICATE CHANGED with both fingerprints and the question to replace the pin (default No). There is no “verification off”.
  3. The login request: SELECT version(), currentUser(), toString(getSetting('readonly')), hostName(), timezone(), uptime(), currentDatabase() with the settings below. The server’s readonly must not be 0, else the tab disconnects.

Every request is a POST with these URL settings:

Setting Value Why
readonly 1 The server refuses writes, DDL and changes of settings (code 164, READONLY).
max_execution_time 60 Seconds per statement (code 159 past it). KryoDesk waits 90 s.
max_result_rows, result_overflow_mode 5001, break The result stops after 5001 rows without an error; the editor keeps 5000 and marks the rest as cut.
default_format JSONCompactEachRowWithNamesAndTypes Read line by line; answers are cut at 32 MiB.
query_id kryodesk-<random> For the console and cancel.

A user whose profile is already read-only refuses some of these (code 164); the console names the step and tries less:

Profile Sent What it means
readonly=0 All of the above —
readonly=1, max_execution_time changeable (changeable_in_readonly) readonly=1, max_execution_time=60 The server’s own result limits apply; KryoDesk still cuts at 5000 rows / 32 MiB.
readonly=1 Only readonly=1 No setting may change: the server’s own time and result limits apply; KryoDesk still cuts at 5000 rows / 32 MiB and waits 90 s.
readonly=2 The limits without readonly readonly may not change, but KryoDesk does not send it: the data stays read-only only while the profile says so. getSetting('readonly') is therefore read again before every editor statement and at least every 60 s while browsing; 0 closes the connection. A statement may change other settings with SETTINGS.

X-ClickHouse-Summary of every answer is read; written rows or bytes reported for a request close the connection. The summary comes with the response headers, so for a streamed result it shows the progress at that moment.

What readonly does not stop (named in the console before sending, nothing blocked; only the user’s grants limit it): table functions that reach outside the server (url, urlCluster, s3, s3Cluster, gcs, azureBlobStorage, remote, remoteSecure, cluster, clusterAllReplicas, mysql, postgresql, mongodb, redis, hdfs, hdfsCluster, deltaLake, iceberg, hudi, jdbc, odbc), files on the server (file, fileCluster, sqlite), executable() and dictionary loads by dictGet*. Calls are found outside strings and comments, whatever the spacing or case (url (, URL/**/().

Server error texts are cut to 16 KiB in the console, the log and the result.

The tree lists the databases of system.databases; tables come from system.tables (engine, total_rows, total_bytes, comment; views, materialized views and dictionaries by engine). Load database sizes sums total_bytes per database. Open structure shows the columns (system.columns: type, default, primary key as PRI, sorting and partition key, codec) and Show CREATE TABLE gives create_table_query followed by the active parts per partition from system.parts (parts, rows, bytes on disk, time range) as SQL comments. ClickHouse functions are global, so no routines are listed.

Rows: every value as substringUTF8(toString(column), 1, 4097), sorted by the chosen column or by the primary key. The quick search finds the text case-insensitively in the text of every (or each chosen) column with positionCaseInsensitiveUTF8(toString(column), {q:String}) > 0; the text travels as the query parameter param_q, never inside the SQL. Names are always taken from system.columns first and quoted with backticks.

One statement per run (the HTTP interface accepts one), sent as typed with the editor’s database; a trailing ; is dropped. A statement with its own FORMAT is shown as raw lines. The server’s error is part of the result: exception code, name and the raw text.

Command What it does
status URL, addresses, host, user, TLS (pin), readonly and the settings of every request.
databases system.databases.
cancel Names the running request and what ends it. KILL QUERY is not sent: ClickHouse refuses it in readonly mode, which every request of the tab uses. The statement ends at max_execution_time (60 s, or the profile’s when KryoDesk cannot set it); to end it earlier, run KILL QUERY WHERE query_id = '…' from a session with write access.
password The password typed again after an app lock wiped it; kept until the next lock, not saved.

Scroll or pinch to zoom · drag to move · double-click to zoom · Esc or click outside to close