Safe Mode and the console
Each PostgreSQL, MySQL, Microsoft SQL Server, MongoDB, ClickHouse, Cassandra, Qdrant, OpenSearch, SQLite and Redis-family connection has a Console view for running your own SQL or commands. Safe Mode decides what the console may run.
Safe Mode is on for production connections and marked in the window header and on the dashboard. You can turn it on for any connection in its settings.
Production access
Safe Mode is an application boundary. It does not revoke write privileges from the database account, prove that the account is read-only, or prevent expensive reads. Use a dedicated read-only account and verify its effective grants, including inherited roles. OpenSearch and SQL Server expose available permission evidence in Access & limits; unverified permissions are not a clean bill of health. Other engines do not gain an account-permission audit in 1.0.0.
Keep query timeouts and result limits in place, and set server-side resource limits where supported. A small result can still require a large scan. For analytics, prefer a read-only replica or separate analytics/search capacity where the engine supports it; check permissions, replica lag and operational impact with the database administrator.
Test connectors first in an isolated database with synthetic data and restricted accounts. The repository provides local Docker fixtures; a separate managed database or VPS is also suitable. Do not use production as the test fixture.
PostgreSQL
Without Safe Mode, the console runs what you type, including several statements at once.
In Safe Mode:
- The console runs one statement at a time. Text with several statements is refused before anything runs.
- The statement runs inside
BEGIN READ ONLY, and the transaction is always rolled back. Whatever the statement does, nothing is committed.
In both modes the console shows up to 1,000 rows per statement and stops the query after that. Cancel stops a running statement.
MySQL
Safe Mode accepts one SELECT, WITH, SHOW, DESCRIBE or EXPLAIN statement. A server-side prepared statement and a read-only transaction enforce that boundary. File output (INTO OUTFILE and DUMPFILE), session assignments, locking functions and executable comments are refused.
Each run uses a dedicated connection. It is rolled back or closed after the query, so session state does not carry into the next run. Results are limited to 1,000 displayed rows per statement; Cancel interrupts a running query, and a run times out after two minutes.
Microsoft SQL Server
The console always accepts one restricted SELECT/CTE, even with Safe Mode off. It displays at most 1,000 rows, 128 columns and 8 MiB of encoded result JSON. Requests have a 10-second deadline and a 3-second lock-wait limit. Cancelling requests TDS Attention, waits up to two extra seconds for acknowledgement and closes that connection; a missing acknowledgement is reported explicitly. SQL Server has no read-only transaction mode. Use a dedicated read-only login and verify views, synonyms, computed columns and inherited permissions with your administrator. See Microsoft SQL Server for the full scope.
MongoDB and ClickHouse
These adapters are always read-only, even if a saved connection is manually changed to disable Safe Mode. MongoDB accepts an explicit subset of JSON find, aggregate, count and explain commands; writes and server-side JavaScript are refused. ClickHouse accepts one read statement, enforces readonly=1 on the server and rejects file output, external sources and settings that could remove the query limits.
Both consoles support cancellation, history and saved queries. Their document, row, response-size and execution-time limits remain in force. Use a database account with read-only grants as an additional boundary. See MongoDB and ClickHouse for the exact limits and unsupported operations.
Cassandra and Qdrant
Both adapters are always read-only, even if a configuration file disables Safe Mode. Cassandra accepts one SELECT with supported built-in functions; writes, batches, USE and arbitrary user-defined functions are refused. Qdrant accepts only query, scroll, count and retrieve JSON operations. Writes, arbitrary URLs and remote inference are unavailable.
Inputs are capped at 64 KiB and responses at 8 MiB. Cassandra displays at most 1,000 rows; Qdrant queries and scroll requests return at most 1,000 points. The client stops waiting after 10 seconds. Stop waiting does not guarantee that the server stops executing the read. Use read-only database grants or API keys as an additional boundary. See Cassandra and Qdrant.
OpenSearch
The adapter uses fixed read-only diagnostics and a bounded JSON search endpoint. Writes, scripts, aggregations, inference, external lookups and search pipelines are unavailable. Searches return at most 1,000 documents and 8 MiB, with a 5-second search timeout, an 8-second server cancellation interval and a 10-second client deadline. Results that time out or terminate early are labeled. Stop waiting does not prove that server work has already stopped. See OpenSearch.
SQLite
Safe Mode opens the console connection read-only with query_only enabled. An authorizer also refuses writes, ATTACH, unsafe pragma changes, extension loading and file-writing functions. Read-only inspection such as PRAGMA table_info and integrity checks remains available.
Without Safe Mode, the console can change the file. Finish explicit transactions in the same run (BEGIN … COMMIT); any transaction left open is rolled back to avoid holding a lock on the application's database. Cancel interrupts the current statement. Results are limited to 1,000 displayed rows per statement.
Redis, Valkey and Dragonfly
Some commands are never run by the console, in any mode, because they never return or change what the console connection is: SUBSCRIBE, PSUBSCRIBE, SSUBSCRIBE, MONITOR, SYNC, PSYNC, SELECT, QUIT, RESET and HELLO. To use another database, edit the connection.
In Safe Mode, Recern asks the server about each command (COMMAND INFO) and runs it only if the server marks it read-only and not dangerous. A short list of harmless diagnostics is always allowed, such as INFO, PING, CLIENT LIST, CONFIG GET, SLOWLOG GET and MEMORY USAGE.
So GET and HGETALL run, while SET, DEL and FLUSHALL are refused, and so is KEYS, which reads but can block a large server.
Changing engines and reusing queries
Safe Mode remains enabled when you change the engine of a production connection. Saved queries and history do not bypass these checks; they load text into the console and use the current connection settings when run.
Recern Vector connections are always read-only and have no SQL console or Safe Mode toggle.
See query history, saved queries and export for the shared console tools.