RaisDBRaisDB
TUI

TUI Read-Only Mode

The safety story for the TUI — and the one known exception.

Default is read-only

raisdb tui starts in read-only mode. The status bar shows a yellow RO badge.

The intent: SSH'd production databases. The default keeps you from fat-fingering a destructive command.

How to enable writes

Via the command

raisdb tui main --readwrite

The status bar flips to a green RW.

In-session

Inside the TUI, enter Command mode (:, then rw or readwrite). The status bar updates immediately.

No shortcut key — restart isn't required, but there isn't a one-key toggle either.

The exception (be aware)

The readonly flag is currently a status-bar signal more than a hard wall inside the TUI.

  • The shell has a real check — execute_sql() calls check_sql_safety_dialect, and writes in a read-only session return without running.
  • The TUI's SQL editor overlay opens with e and runs with Ctrl+R. The SQL still flows through the safety checker, but the engine used is engine.query() rather than engine.execute(), and there is no if app.readonly gate before Ctrl+R. The status bar reminds you, but the safety checker is what actually stops destructive SQL.

If you're using the TUI in a multi-tenant or hostile environment, restart with --readwrite only when you intend to.

Combining with SSH

ssh bastion -t "raisdb tui prod-db"

The -t allocates a TTY, which the TUI requires. With Read-only default, this is safe on a bastion that reaches production.

On this page