Safe Mode

Protect important databases by confirming, authenticating or blocking every write before it runs.

Safe mode decides what happens before Mantidb writes to a database. It applies to everything that changes data or structure: grid edits, queries you run, structure changes, imports and more. Each connection has its own safe mode, which by default comes from its tag.

The four modes

ModeWhat happens before a write
SilentRuns it right away.
Confirm writesShows a confirmation sheet with the SQL.
Confirm + Touch ID for writesShows the confirmation sheet, then asks for Touch ID or your Mac account password.
Read onlyRejects it.

Reads, such as SELECT queries and browsing tables, are never interrupted.

Defaults by tag

New connections use Default for tag, so their safe mode follows the tag:

TagDefault safe mode
LocalSilent
DevelopmentSilent
TestingSilent
StagingSilent
ProductionConfirm + Touch ID for writes

To give one connection a different mode, choose it in the Safe mode field of the connection form. A connection's own setting always wins over the tag default.

How writes are detected

Mantidb is conservative: a statement counts as a read only when it's clearly one. These count as reads:

  • SELECT, SHOW, VALUES, TABLE, DESCRIBE and DESC — unless they contain INTO or FOR UPDATE.
  • EXPLAIN without ANALYZE.
  • WITH queries that contain no write keywords.
  • PRAGMA without =.

Everything else counts as a write, including any statement Mantidb doesn't recognize. SELECT pg_terminate_backend(…) and SELECT pg_cancel_backend(…) also count as writes, because they affect other sessions.

The confirmation sheet

In Confirm writes and Confirm + Touch ID for writes, Mantidb shows a sheet before running anything:

  • The title reads Run N statement(s) on <connection>?
  • The subtitle shows the tag and safe mode, and explains how the SQL runs: in a single transaction, or one by one stopping at the first error.
  • Below is the exact SQL, in a scrollable preview.

Review the SQL, then confirm to run it or cancel to go back. For Production connections the sheet uses a critical alert style, so it stands out.

Change it per window

You can change the safe mode of an open window without editing the connection:

  1. Click the connection card at the top of the sidebar.
  2. Choose a mode from the Safe Mode picker.

The change applies to that window. The Redis and MongoDB browsers have the same picker in their header card.

Always-confirm actions

Some actions are risky enough that Mantidb always asks before running them — even in Silent mode. In Read only they're blocked.

Settings ▸ Safe Mode

Open Mantidb ▸ Settings… (⌘,) and choose the Safe Mode tab to change the default for each tag. There's one picker per tag — Local, Development, Testing, Staging and Production — with the four modes. Click Restore Defaults to go back to the original settings.

These defaults apply to connections set to Default for tag. New windows pick up the change; windows that are already open keep their current mode.

On the iOS app, the Mac's Settings defaults aren't used: Production connections use Confirm + Face ID for writes, and the other tags use Silent.