This tutorial will show you how to view foreign keys using DataGrip.
From View -> Tool Windows in toolbar select Database (or press Alt + 1).
Fig. 1. Database in toolbar
In opened explorer search for table which foreign keys you want to see. You can identify foreign keys in two ways:
Fig. 2. Modify Foreign Key option
Both actions opens the same window which contains all FK information like parent table, used columns and modify rules.
Fig. 3. Foreign Keys details
In Database explorer find table like in previous option, but this time instead of clicking on Modify Table option in context menu, select Diagrams -> Show Visualization…
Fig. 4. Diagrams in table context menu
This will result in generating database diagram with this table and full chain of related tables like in example below:
Fig. 5. Tables relation chain
If you want to know more about any relation, unfortunately you can do this only by right click on appropriate table and selecting Refactor -> Modify table which leads to same options as in Option 1.
Fig. 6. Refactor options in Diagram workspace