Environments

functional

Make development, staging, and production unmistakable variants of the same target.

An Environment marks which version of a target a connection uses: Local, Dev, Test, Staging, or Production. It gives the important question - “is this production?” - a clear answer before you run anything.

Assigning an environment

Use the connection editor's PROD / STAGE / TEST / DEV / LOCAL control to set the environment; select the highlighted one again to clear it. Unlike clients and projects, the list is fixed, you choose from these five rather than typing a name.

Dev, Test, Staging, and Production also exist as entities in Tools › Manage Clients, Projects & Environments..., ready from the first launch, with Production's Production environment protection already ticked. They start without a color or icon: give each one there, and it appears on the environment's badges and group headers. Local, and a cleared environment, carry no entity and show no badge.

Safety that rides the environment

  • Production forces SELECT-only and rollback-wrap on, marks the connection production, and shows a PRODUCTION chip in the status bar, keeping writes locked until you deliberately unlock them for a timed window.
  • Staging forces rollback-wrap on.
  • Lower environments add no restrictions - and these defaults only ever turn safety on.

In the editor, picking PROD ticks the connection's own Block all but SELECT and Wrap execution in transaction + rollback boxes, and STAGE ticks the rollback box. Moving a connection back to a lower environment does not untick them; clear them yourself if you mean to.

Need an exception? The editor's Production mode control, Inherit from environment, Production, or Not production - has the final say on the production flag, even over a client or project that marks it production.

SQLly
SQLly environment badges including a production chipSQLly environment badges including a production chip
Environment variants of one target, with the production connection badged in the status bar.

What changes when a connection is production

Connect to a production connection and several things change at once:

WhereWhat you see
Above the editorA banner reading PRODUCTION — read-only, with Unlock 1 min, Unlock 5 min, and Unlock 15 min buttons.
Status barThe Production environment badge in its color and icon, plus the PRODUCTION chip.
ExplorerThe server row's environment dot in Production's color (once you have given it one); the row's tooltip lists Environment: Production.
Welcome screenSaved connections listed there carry an environment chip - red for Production, amber for Staging, green for Dev and Test.
Running SQLData-changing statements are refused while writes are locked. Admin dialogs that would write tell you to unlock first.

Unlock writes from the banner, or from the command palette's Unlock Production Writes for 1 Minute (or 5 or 15 Minutes). While the window is open the banner reads PRODUCTION — writes unlocked, 4:59 left, the status-bar chip counts down as PRODUCTION · 4:59, and every data change still asks you to confirm before it runs. When the time runs out the connection locks again by itself; Lock now on the banner, or Lock Production Writes Now in the palette, ends it early.

Color prod an angry red. Give each environment its own color and the difference reaches your peripheral vision before it reaches your fingers.

Environments elsewhere in the app

  • Explorer grouping - By environment gives you Dev, Production, Staging, and Test folders; Local and unset connections go to “Unassigned”. See Grouping views.
  • Run on… - when you run one script against several connections, the target list is grouped by environment, Local first and Production last, so the risky targets are easy to see before you tick them.