DataGrip 2019.3.2: Virtual foreign keys and more!

Posted on by Maksim Sobolevskiy

Hello! This is the second bugfix update for DataGrip 2019.3. Here’s what it has inside:

Virtual foreign keys

We’ve introduced the concept of virtual foreign keys. You can use this concept in the event that you need to use a relationship that exists but is not located in your database.!

Doing so will help you:
– Have the proper completion when writing JOIN clauses.
– See the relations in diagrams.

By default, DataGrip tries to guess if you have relations between columns whose names contain id. It looks like this:

Completion

These relations are also displayed in the diagram. If you don’t want them to be there, just click on the corresponding icon on the toolbar.

Diagram

You can also create a custom rule under Settings | Preferences for guessing whether there are relations: :

Settings

As you can see, DataGrip 2019.3 only includes one pre-built pattern, which was particularly designed to handle the examples above. You can add your own with the help of the regular expressions. To learn more about this feature, you can visit our help page.

When you write code, any relation from the JOIN clause can be stored as a virtual foreign key. Press Alt+Enter and choose Store table relation.

StoreRelations

DataGrip will ask you to identify a file where these virtual relations will be stored.

XMLFileChooser

The resulting XML file will look like this, and you can then edit it directly:

XML

Stored procedure runner for MySQL

Finally, after adding the option to execute stored procedures in PostgreSQL, MS SQL and Oracle, we’ve now made it possible to do so in MySQL.

ExecuteProcs

Important bug-fixes

DBE-9829 Aliases are no longer used when completing table names in DDL.
DBE-9800 Only trigger functions are offered in the corresponding completion list.
DBE-9803 The wildcard is now resolved inside row constructors.

Thanks!

DataGrip team.

Comments below can no longer be edited.

4 Responses to DataGrip 2019.3.2: Virtual foreign keys and more!

  1. Vladimir Solovev says:

    January 23, 2020

    Thank you for the virtual foreign keys. Useful to support the legacy.

  2. Scott Burfield-Mills says:

    January 23, 2020

    I am working with a SilverStripe (PHP) code base and it does not use foreign keys, often using One-to-One tables where the ID field is the same value across many tables.

    Virtual foreign keys are going to write my JOIN code completion much, much better.

    Thanks!

  3. Mohammad Jafar says:

    January 27, 2020

    That’s awesome to see these improvements coming up. Wish Datagrip also resolved the issue I’m seeing with storing the passwords. It’s asking for the password every time the client is closed and re-opened. Fyi – The password is saved with a “Forever” option.

    • Maksim Sobolevskiy says:

      January 28, 2020

      Can you please send us logs (Help – show logs in..) to datagrip@jetbrains.com?