DataGrip Overview, Part 2: Database Explorer
In a Nutshell
DataGrip's Database Explorer lets you manage data sources, hide/filter objects, organize into groups, and assign colors for visual distinction. Key productivity features include virtual foreign keys for navigation without schema changes, default views for saving query results as explorer objects, and structure comparison with automatic migration script generation. Objects can be copied/duplicated via XML export, and relationships visualized through interactive diagrams.
These notes were generated by AI and may contain inaccuracies.
The left side of the screen displays the Database Explorer, which includes all data sources being worked with. The Database Explorer allows viewing and modifying database objects and performing other related tasks.
When expanding all nodes, schedules, presentations, routines, and other beings are visible. Clicking the "one of three" button allows choosing which databases and schemas to display in the tree and which will be examined. DataGrip has many options for displaying objects, accessible below the eye icon.
Separating Procedures from Functions
Procedures and functions can be separated. If not specified, they will all be placed under the Routines subfolder.
Show All Namespaces
This option effectively displays plans that were not selected for inspection.
Hide Scan Level Icons
Scan level icons can be hidden if displaying them is not useful.
The quick search function helps find needed objects. Typing "pay" displays tables that begin with these three letters. Shortcuts can also be used - typing "pp01" treats it as an abbreviation and selects the corresponding table. Objects will be highlighted if the relevant nodes are open.
To keep data sources organized, place them into groups by pressing F6 on a data source to place it in an existing group or create a new group.
There is an option to hide objects not needed. For example, payment schedule division tables beginning with "payment" can be hidden by going to the Charts tab in Data Source Properties and specifying the pattern expression that will hide these tables. This setting does not affect the inspection process - it hides objects from the user interface only.
Data sources can be copied by placing the cursor on the data source and pressing Command C, which places an XML extract in the clipboard. This XML snippet can be pasted as a new data source into the Database Tool window, whether within the same IDE or in another JetBrains IDE environment. The only thing that needs to be specified again is the password, which is not copied from the data source.
Data sources can be duplicated by pressing Command and D keys and entering the new password, just as when copying databases.
Colors can be assigned to any data source to distinguish between production and test data sources. Choosing gray will use this color for everything related to the data source, including the database tree, result set, associated SQL files, and navigation outputs.
The connection between different tables can be displayed in a graph by bringing up the context menu and selecting "Show diagram". This creates a large graph based on the chart. Zooming in and out allows exploration of all relationships. All navigation features work here, allowing editing of the chart or data in the tables directly from the graph.
When actual external key constraints cannot or should not be defined, virtual external keys allow retaining the advantages of navigation, code completion, and graphing without changing the database schema. The default external key exists only in the IDE. For example, if visitor_id is not an actual external key for visitor.id, this relationship can still be created by default and reused later. Alt + Enter is the shortcut for this.
After the default external key is created, code autocomplete will take it into account, and this hypothetical relationship will appear in the graph. The definition of each default external key is stored in the external-data.xml file. To examine it, right-click on the table containing the default external key, go to "Tools", then "Edit external objects file".
To monitor the results set of an SQL query run regularly, create a default view. The default view is a side object specific to the IDE. Its data is not stored in the database and cannot be queried using a regular SELECT. However, its results appear in the database explorer just like a table or view. To create one, copy the query to the clipboard, create a new default view via the context menu, paste the query, and choose a name. The default view can then be seen in the database explorer, and double-clicking shows the actual data.
The structure of two different diagrams can be compared by selecting "Compare Structure" from the Tools menu. A dialog window will open. The migration process will be from left to right, but the direction can be reversed using the corresponding button. Differences between the diagrams and between each object individually can be seen. The bottom of the screen contains a migration script that will be executed if the execute button is pressed.
Keep JetBrains in your library
Save the videos and channels worth coming back to, and find them again in one place.





