DataGrip 2019.1 Help

Customizing the database tree view

Your database tree is shown in the Database tool window. This tool window lets you view and modify data structures in your databases, and perform other associated tasks.

You can filter, group, and sort the database objects that are shown in the Database tool window for each data source and display only the objects that you need.

Synchronize the database state

If someone changed the remote database data or view, the local view of the database might differ from the actual state of the database.

To synchronize the database state automatically, in the Database tool window (View | Tool Windows | Database), click the Data Source Properties button (the Data Source Properties button) and select the data source that you want to change. On the Options tab, select the Auto sync checkbox.

If the Auto sync checkbox is cleared, the view of the data source in the Database tool window (View | Tool Windows | Database) is synchronized with the actual state of the database only when you click the Synchronize icon (the Synchronize icon) or press Ctrl+Alt+Y.

Synchronize the database state

Filter objects from the toolbar

To select the necessary objects, use the Filter icon on the toolbar (the Filter icon).

The Filter menu

Filter objects with the object filter

Specify filtering options in the Object filter field on the Schemas tab of the Data Sources and Drivers dialog (the Data Sources and Drivers dialog).

Use the following pattern when you compose an expression for the Object filter field.

<type>:[-]<pattern>, where:

<type> might be an aggregate, collation, event, fdw, ftable, mview, operator, package, role, routine, sequence, synonym, table, user, view, vtable.

<pattern> is a regular expression.To exclude an item, prepend with - (minus). For more information about regular expressions, see Class Patterns at JavaTM 2 Platform Standard Edition 5.0 API Specification.

Consider the following examples that demonstrate the filter syntax:

  • f.*

    Show only objects whose names start with f.

  • table:[gh].*

    Show tables whose names start with g or h, and all other object types.

  • view:new_.*||routine:-[ps].*

    Show views whose names start with new_, routines whose names start with any letters except p or s, and all other object types.

The Object Filter field in data source options

Group data sources

To group, enable, or sort data sources, click the Show Options menu icon (the Show Options menu icon) on the title bar of the Database tool window and select the necessary options.

the Show Options menu icon

Assign a color to a data source

To have better differentiation between production and test databases, you can assign a color to a data source.

  1. Navigate to File | Data Sources (N/A).

  2. Select the data source for which you want to assign a color.

  3. Click the Choose color icon (The Choose color icon) and select a color.

  4. Click OK.

Assign a color to a data source