ClickHouse safe mode and review
Safe mode confirms writes before they are sent, read-only connections refuse anything not recognized as a read, and mutations are reviewed.
New ClickHouse connections start in the “Confirm writes” safe mode. Tablyne classifies each statement before it is sent. A statement counts as safe only if it is a recognized read, such as SELECT, WITH, SHOW, DESCRIBE, EXISTS or EXPLAIN. Everything else needs confirmation, and a blocked write is never sent.
A read-only connection is stricter. It refuses INTO OUTFILE, table functions that reach outside the server, and SETTINGS that weaken a safeguard. It also sends readonly=1 to the server, so the check is not Tablyne’s alone. Write permission itself still comes from the server user.
Row edits are reviewed before they are sent. The review shows the statement and, for ReplacingMergeTree tables, warns that concurrent edits may overwrite each other. Each write is pinned to the table you read by its UUID, inside the same command. If another session swaps the table with EXCHANGE or RENAME, nothing is written to the other table.
If the connection drops after a write was sent, Tablyne cannot know what happened. It marks the row “check”, does not resend, and asks you to verify on the server.
Mutations by filter have their own review. It shows the exact SQL, an estimate of the parts and rows read by the filter, and warnings: asynchronous, can affect many rows, no rollback. You type the table name to send it. A change to the whole table needs the name typed too. On a connection marked as production, row writes ask you to type a confirmation too.
Structure changes run one step at a time, without a fake transaction. If step three fails, the first two stay applied, and the message says how many.
User, role and grant changes are reviewed too. Users stored in users.xml or LDAP are shown as read-only with the reason.