Safety
Two different controls. Settings → Safety decides when MoleDB asks before a write. Read-only (safe mode) is on the data source, and it blocks writes on that connection.
The environment on the data source is Not set, Local, Staging, or Production. How to set it is on Data sources. Not set uses the Production safety settings.
Settings → Safety
Pick Local, Staging, or Production. Each one has its own switches:
- Confirm before running more than one statement
- Confirm destructive writes
- Confirm writes at or above, a row count
Local and Staging start with both confirms off. Production starts with both on. The row count starts at 50 everywhere, so turning write confirmation on uses that count. 0 asks before every destructive write. Save writes this on your Mac (safety.json). The notice is Saved on this machine.
A data source can set its own Confirm writes at or above. Blank inherits the number for its environment. A number saved on the connection turns write confirmation on at that count, even when the environment has the switch off. It does not change the multi-statement switch. That one stays with the environment.
Read-only (safe mode)
The switch is on the data source, labelled Read-only (safe mode). It blocks INSERT, UPDATE, DELETE, DDL, and Edit Data commits on that connection. Statements that are not clearly queries are refused as well. The database session is opened read-only, so the engine can reject a query that would change data through a function. Access scripts are not started, and a new SQLite or DuckDB file is not created.
SQL Server does not offer the switch. It has no read-only session. See Supported databases.
The console shows a read-only badge when the connection is in this mode. See SQL console.