Help › Stay safe

Stay safe on production

What Querlyn does differently on a Production connection, and the tools that protect you everywhere, with links to each in detail.

Querlyn 0.1.0 is not released yet. This help describes it ahead of release.

Every connection has an Environment: Local, Development, Testing, Staging or Production. You choose it when you add the connection; see Choose an environment. It tells Querlyn how much is at stake, and Querlyn is more careful the more there is.

Local, DevelopmentTesting, StagingProduction
RiskLowMediumHigh
Asks before a statement runsNeverBefore destructive statementsBefore destructive statements and statements it cannot classify
Tabs start with auto-commitOnOnOff
Waits for another session's lock at most (on PostgreSQL, MySQL, MariaDB and SQL Server)No limit30 seconds10 seconds
Reminds you of a transaction left open after15 minutes5 minutes2 minutes
Restoring a backupAsksAsks you to type the database's nameAsks you to type the database's name
Query history starts by keepingThe SQLThe SQLWhen and how a statement ran, not its SQL

A label you made up yourself, such as "Customer demo", behaves like the risk level you gave it.

Know when you are on production

A Production connection is marked in red wherever it appears: a red dot on each of its tabs, a red edge on the bar above the editor, and a red PRODUCTION label at the left of the status bar while one of its tabs is in front.

What Querlyn asks about

Before a statement runs, Querlyn reads it and decides whether it could destroy data: a DROP, a TRUNCATE, a DELETE or UPDATE without a WHERE clause, and others. When the environment calls for it, Querlyn shows the statement and what it would do, and runs it only if you confirm.

On Production, it also asks about a statement it cannot classify. It cannot tell that such a statement is harmless, so it does not assume so.

On a database that bills by the bytes a query reads (BigQuery), Querlyn estimates every run first, and on Production asks before one that will read 1 GB or more, stating the bytes. Each connection can set another size, or turn this question off, under Ask before reading. See Connect to Google BigQuery.

On Cassandra and ScyllaDB, a Production connection asks before a SELECT with ALLOW FILTERING runs, which reads the table across the cluster, and before Explain, which there runs the read to trace it. See Query Cassandra.

Confirm risky statements has the full list, what the question looks like, and how to change when Querlyn asks.

A statement run on several connections at once asks one question for the set, naming every Production connection in it, and asks about any change of data when the set has one. See Run a query on several connections.

On a Mac with Touch ID, these questions, and the Commit of a dry run, can take your fingerprint instead of a click. See Confirm with Touch ID.

See a change before you commit it

Dry Run (⇧⌘D on macOS or Ctrl+Shift+D on Windows and Linux) runs an UPDATE or DELETE without committing it and shows how many rows change and how, before you choose Commit or Roll Back. The question before a destructive UPDATE or DELETE offers it as Dry Run First. See See a change before you commit it.

Commit by hand on production

On a Production connection, query tabs start with auto-commit off. What you change stays in a transaction, and nothing is permanent until you choose Commit (⇧⌘K on macOS or Ctrl+Shift+K on Windows and Linux). Roll Back (⇧⌘⌫ on macOS or Ctrl+Shift+Backspace on Windows and Linux) undoes it. While a transaction is open, its tab is marked TX.

To change this for a connection, choose Query › Toggle Auto-Commit in one of its tabs. See Commit and roll back changes.

ClickHouse and Snowflake cannot keep a transaction open between runs, so their tabs commit each statement at once, on Production too.

Do not hold others up

A transaction left open holds locks that other sessions may wait for. Querlyn tells you when sessions are waiting on your transaction, reminds you of a transaction you left open, and stops a statement of yours that waits too long for someone else's lock. See Lock waits and timeouts.

Before a schema change that would make others wait on a large table, Querlyn warns you and offers a form that does not block. See Migration lock warnings.

Make a connection read-only

Turn on Read-only in the connection's dialog, or select the connection and choose Query › Toggle Read-Only. Querlyn then refuses statements that change data on that connection, and its results cannot be edited. The bar above the editor shows Read-only while it is on.

Turning read-only off on a Production connection asks for confirmation first. See Read-only connections.

What is recorded

For Production connections, the query history keeps when each statement ran and how it ended, but not its text, because SQL can contain customer data. For other environments it keeps the text as well. That is where each connection starts; Query history in a connection's dialog changes it for that connection. See Search the query history.

The statement console shows the SQL of every connection while Querlyn runs, and keeps nothing after you quit. See See what Querlyn sends.

Mask sensitive columns

Columns you mark sensitive, such as email or ssn, are masked on Production connections whenever their rows are shown, and on every connection in screen-share mode, which also hides host names, users and databases before you share your screen. See Share your screen safely.

What Querlyn cannot protect you from

  • What a stored procedure, function or trigger does when your statement calls it. Querlyn reads the SQL you run, not the code it calls.
  • A WHERE clause that is there but wrong. DELETE FROM orders WHERE id > 0 has a WHERE clause and deletes everything.
  • A connection marked with the wrong environment. A production database marked Development gets none of the above.

Help for Querlyn 0.1.0. All help topics