Database objects


Database view window contains all your data sources and their schemas with tables, functions, and views, etc. divided into folders which can be collapsed and expanded.

Choose schemas to introspect

Click on the n of m text area and select the schemas you need for your work.

Object filter

In data source properties you can define if some objects should be hidden in the database tree view. For instance, you if don't want to see the tables with some prefix.

The Ctrl+Q shortcut will give you information about the syntax. On the picture we've excluded all tables with names starting with payment_.

Group data sources

Group data sources by type, for instance database vendor. Press F6 or choose Move to group… from the context menu.

Drag-and-drop also works for creating groups in the database explorer. To create a new group, just drag one data source onto the other. To place the data source into an existing group, drag-and-drop it there.

Copy data sources

It frequently happens, that you want to use the same data sources in another project or even the other IntelliJ-based IDE. Select the data sources you want to share and then go to the context menu → Database Tools → Copy Data Sources to Clipboard.

Paste data sources

To paste the data source, press + and then Import from Clipboard. In your clipboard you have just an XML, so you can even send it via messenger.

Generate SQL files for the selected objects

With the SQL Generator (Ctrl+Alt+G) you can generate the SQL files for the database objects. To do this, click the Save button on the left pane. We’ve created two layouts for the output: File per object and File per object with order.

Quick table backup

It is possible to copy table to the same data source via drag-n-drop. This could be very handy if you ever needed to create a quick backup of the table before any crucial data manipulations.

Create/modify table

The IDE provides a unified UI for adding or editing tables and table components: columns, indexes and constraints. This window has all the controls you need to define all of these components. Note that if Execute in database is enabled, all your changes will be immediately applied to the database.

Press Ctrl+F6 on the table name in either the database tree or the SQL-script to modify them. The Create/Modify Table window also has an instant preview to help you work with database objects and generate code effectively. To learn more about creating and modifying objects, please see code generation.

To edit data in the table, press F4. See data editor.

Edit source code

Invoke the Edit action for any database object by pressing Ctrl+B and get a DDL statement for procedures and functions, or you can just double-click on the object in the database explorer.

The gutter (the vertical bar to the left of the text editor) will highlight the changes you’ve made. After you click Submit on the toolbar, the migration dialog will show the generated SQL code to update the source code.

DataGrip keeps the source code of database objects in local storage. It means that you can see the parts of the source code you've changed and it's able to revert any change back to the server version.

Additionally, the source code storage lets you search for particular pieces of code through the entire source code of your database.


With DataGrip you can always see your tables and their relationships in an insightful diagram, available by pressing Ctrl+Alt+U or from the context menu of the objects you want to visualize. The column with primary and foreign keys can be hidden from the diagram and be shown only on relation lines. These diagrams may be exported to image files when necessary.