Skip to content

ConnectionsOrganize

Color-code connections

Assigning custom colors to your connections in DBCode helps you visually separate environments like development, staging, and production.

  1. Open DBCode in Visual Studio Code:

    • Select the DBCode icon in the Activity Bar.
  2. Select the Connection:

    • In the DBCode Explorer, locate the connection you want to color.
  3. Set a Connection Color:

    • Right-click the connection and choose Edit Connection from the context menu.

    • In the Edit Connection tab, use the color swatch next to Connection name to choose a color.

    • Select Save connection to apply the color.

    Setting a connection color

After saving, the selected color appears in these places by default:

  • The connection item in the DBCode Explorer. DBCode colors the connection name and status indicators, like the default marker and connected indicator, while leaving the main database icon unchanged.
  • Primary key indicators for tables in that connection.
  • Editor tabs associated with the connection.
  • SQL file headers associated with the connection.

You can color a connection group to visually separate whole environments at once.

  1. Set a Group Color:

    • Right-click a group in the DBCode Explorer and choose Set Color, then pick a color.
  2. Clear a Group Color:

    • Right-click the group and choose Clear Color. This option appears only when the group has its own color.

A group’s color cascades to its sub-groups and to the connections inside it that do not have their own color. A connection or sub-group with its own color keeps it, overriding the inherited one. The color tints the group and connection names; the folder icon itself is drawn by your VS Code file-icon theme and is left as-is.

Modifying Color Settings in the Extension Settings

Section titled “Modifying Color Settings in the Extension Settings”

You can choose where DBCode applies connection colors in Visual Studio Code:

  1. Open Settings: Press Cmd+, on macOS or Ctrl+, on Windows and Linux.

  2. Search for DBCode color settings: Search for DBCode connection color.

  3. Configure DBCode color settings: Adjust the DBCode color settings for editor tabs, the status bar, and the command center.

    DBCode color settings

DBCode keeps the selected color for that connection across Visual Studio Code restarts. The extension settings control which VS Code surfaces also use the color.