DataGrip 2020.3 Help

Review changes in source code

Everything that you write in the editor is saved as the local version of the object source code. You can examine all changes that are not committed in the Database Changes tool window.

The Database Changes tool window displays changes in source code of objects before you commit them. DataGrip tracks changes only for objects that store their source code in the database. For example, triggers, procedures, functions, views, and other objects.

The Database Changes Tool Window

See the diff between modified and stored versions

  • In the Database Changes, double-click any database object.

    See the diff between modified and stored versions
  • When you edit source code of any object, DataGrip tracks changes and highlights them in the gutter. For example, add a comment line to a routine or a trigger function. The added line becomes highlighted. If you click the highlighted line in the gutter, a small toolbar is displayed with the Show Diff button. You can click the Show Diff button (the Show diff icon) to see the difference between the code that you added and the one from source code.

    IDE highlights changes in source code

Load source code for a data source

  1. Open data source properties. You can open data source properties by using one of the following options:

    • Navigate to File | Data Sources.

    • Press Ctrl+Alt+Shift+S.

    • In the Database tool window (View | Tool Windows | Database ), click the Data Source Properties icon The Data Source Properties icon.

  2. Select one or more data sources for which you want to download source code.

  3. Right-click the selection and navigate to Load Sources. You can select between the following options:

    • None: do not download source code.

    • Except System Schemas: download source code for all the objects except for system schemas.

    • All Schemas: download all the available source code.

    Load source code for a data source

Controls of the Database Changes tool window

ItemShortcutDescription
the Submit button SubmitCtrl+EnterSubmit local changes to the database server. See Submit changes to a database.
the Rollback button RollbackRoll back changes.
Compare with Show DiffCtrl+DCompare two versions of source code.
Group by Group byCtrl+DGroup objects according to their type. For example, routines, rules, or views.
the Expand All buttonCtrl+NumPad +Expand all nodes in all trees.
the Collapse All buttonCtrl+NumPad -Collapse all nodes in all trees.
Last modified: 08 March 2021