Help › Connect to databases

Connect to ClickHouse

What a ClickHouse connection needs, which port to use, and what is particular to ClickHouse in Querlyn.

Querlyn 0.1.0 is not released yet. This help describes it ahead of release.

Querlyn talks to ClickHouse through its HTTP interface, the one ClickHouse Cloud, proxies and load balancers expose. It needs ClickHouse 25.8 or later.

What you need

  • The server's host name.
  • The HTTP port: usually 8123 without encryption and 8443 with it. These are not the ports of the native protocol (9000 and 9440), which Querlyn does not use.
  • A user and its password.
  • Optionally the database to start in. If you leave it empty, Querlyn opens default.

Fill in the dialog

  1. Choose File › New Connection… and, under Database engine, ClickHouse.
  2. Enter the Host.
  3. Choose TLS. The Port follows it while you have not typed one yourself: 8123 for Disable and Prefer, 8443 for Require (no verification) and Verify full.
  4. Enter the User, and the Password or another place under Where the password is kept.
  5. Choose Test Connection, then Save & Connect.

For localhost the dialog starts at Prefer and port 8123; for any other host at Verify full and port 8443. With Prefer, Querlyn tries HTTPS first and uses plain HTTP only when the port does not speak TLS.

What is particular to ClickHouse

  • There are no transactions. Every statement takes effect at once. The tab's Auto-commit control is shown but cannot be changed, and Begin Transaction says why. A Production connection still asks before destructive statements; it just cannot start with auto-commit off.
  • Rows cannot be edited in the results. ClickHouse changes rows with mutations that run in the background, which does not fit editing a cell and seeing the result.
  • Each tab keeps a ClickHouse session. Temporary tables, SET and USE last from one run to the next. A session left idle for an hour (or less, if the server says so) ends; Querlyn says so and starts a new one.
  • Databases are listed as schemas, as for MySQL. Dictionaries have a folder of their own and open like tables. A table's Properties folder shows its engine, its sorting, primary, partition and sampling keys, its TTL, and its rows and size.
  • A statement's own FORMAT is honored: the output is shown as lines of text in one column.
  • Parameters are written the ClickHouse way, {name:Type}, for example {day:Date}.
  • Explain works for SELECT statements. There is no Explain Analyze.
  • Server Activity lists running queries, not sessions. Cancel Query and Terminate Session… both stop the query.
  • Importing a file is not one transaction. Rows are loaded into a temporary table first and then inserted in one statement, so a failure before that last step leaves the table untouched. If the server fails during the last step, some rows may already be in a table that has several partitions; the import dialog says so.
  • Schema changes are waited for. When the table designer applies a change, Querlyn waits until ClickHouse has finished it, so the result you see is what happened.
  • Generated DDL has no ON CLUSTER. That suits ClickHouse Cloud and replicated databases. On a classic cluster, choose Open in Editor in the table designer and add ON CLUSTER yourself.

What Querlyn does not do

  • Backup and restore. ClickHouse writes backups where the server is configured to, and Querlyn cannot fetch the file.
  • Cloud sign-in, the "blocking others" notice, lock and statement timeouts, and migration lock warnings.
  • Foreign keys: ClickHouse has none, so an ER diagram shows tables without relationships.

Help for Querlyn 0.1.0. All help topics