A connection profile shows on screen which environment a connection belongs to (local, development, production and so on) and sets how carefully SQL is run on it. You set it in the Profile tab of the connection dialog. Whose setting a profile is and which executions it applies to is explained in Safeguards for production databases.
What's on the screen
| No. | Name | Description |
|---|---|---|
| 1 | Environment | Choosing an environment fills in Color, Background watermark and Protection mode with that environment's values (table below). You can then change each one. |
| 2 | Reset button | Returns the profile to its initial state (the Custom environment, Color None, Background watermark off, Protection mode None). |
| 3 | Color | The color that tells the connection apart. There are ten swatches and a color picker; the X swatch clears the color. |
| 4 | Label (optional) | The text used as the watermark. If left empty, the value of Connection name is used. |
| 5 | Background watermark switch | When on, the label is laid over the background of the SQL editor and the ERD. |
| 6 | Protection mode | Whether to confirm before running SQL on this connection, or to allow only queries. |
| Environment | Color | Background watermark | Protection mode |
|---|---|---|---|
| Local | Teal | Off | None |
| Dev | Blue | Off | None |
| Staging | Orange | Off | Confirm (DDL + risky DML) |
| Prod | Red | On | Confirm (DDL + risky DML) |
| Custom | Left as is | Left as is | Left as is |
Which statements a protection mode confirms or blocks, and which execution paths it covers, is explained under 'Protection modes' in Safeguards for production databases.
Setting a profile for a production connection
- Right-click the connection in the explorer, choose , and open the Profile tab.
- In Environment (1), click Prod. Color is set to red, the Background watermark switch to on, and Protection mode to Confirm (DDL + risky DML), all together.
- For a connection used only for queries, choose Read-only (block non-SELECT) in Protection mode (6).
- To use different text instead of the value of Connection name in the watermark, enter it in Label (optional) (4).
- Click the Save button.
After you save, the SQL tabs of this connection color the work tab marker (1) and the line next to the line numbers (2) with the chosen color, and lay the label (3) over the background.
Idle timeouts that follow the environment
In the desktop app, the chosen environment also sets the SQL tab idle timeouts. When nothing is run in a SQL tab for the time set in Transaction idle timeout, uncommitted changes are rolled back; after the time set in Connection idle timeout, the database connection is closed.
| Environment | Connection idle timeout | Transaction idle timeout |
|---|---|---|
| Local | 240 min | 120 min |
| Dev | 180 min | 90 min |
| Staging | 120 min | 60 min |
| Prod | 60 min | 30 min |
| Custom, no profile | 60 min | 30 min |
- These are the initial values. Change them per environment, between 30 and 720 minutes, in the tab. These values are personal settings too.
- The web app has no such option; the connection idle time is fixed at 30 minutes and does not follow the environment.
- Picking a color yourself in Color switches the environment to Custom, so the idle timeouts follow the Custom environment as well.
Things to keep in mind
- A profile is a personal setting. Setting Protection mode to Read-only (block non-SELECT) for yourself has no effect on your teammates' screens or on other tools. To block execution for sure, reduce the database account's privileges (Safeguards for production databases).
- A connection without a profile has Protection mode set to None.
- Clicking a button in Environment again resets Color, Background watermark and Protection mode that you changed one by one to that environment's values.
- In an account project, this tab opens and saves even if you cannot edit the connection. Saving changes only your own profile.
Related screens
- Safeguards for production databases: which executions the protection modes, the dangerous SQL check and DDL approval apply to.
- Create and edit a connection: the other tabs of the connection dialog.
- Project settings: the SQL editor tab where the idle timeouts per environment are changed.
- Connect to a production database safely: the steps for connecting a production database with a secure connection and a profile.