DataGrip 2016.2 New EAP build: Language injections, ligatures, recompile in Oracle
Hello! We’ve prepared a new build for our early adopters. Here’s a list of the most interesting things you can find inside.
Language Injections
Quite possibly the most important feature of this build, it lets you treat string literals as live code written in other languages (like XML, JSON, any SQL dialect or even regular expressions), including formatting, highlighting, usage search, completion, and even refactoring.
Let’s have a closer look at how this feature is useful when you’re working with DataGrip.
Language is auto-injected into a literal when DataGrip is 100% positive of the nature of its contents. For example, if you are working with values from JSON columns, they will be treated as such.
Language can also be injected when you’re specifying a column default value. In the following case it’s XML, which makes all the XML-related features available there: rename elements by Ctrl/Cmd+F6, find usages by Alt+F7, and enjoy completion for attribute names. For more information about XML support you can have, read this IntelliJ IDEA help page. DataGrip and IntelliJ IDEA share a common platform, everything described there will work in DataGrip just as well.
By default, there are only two predefined injection types: JSON and XML. However, it’s really simple to create your own injections: just press Alt+Enter and then select Inject By Type.
There are many languages you can inject.
You will be offered to create a custom type pattern that simplifies the use of injections, for instance, you can configure it to inject XML into any field ending with DATA. You can use regular expressions to define the injection patterns. There’s RegExp assistance, too: Alt+Enter invokes the Check RegExp feature.
Your pattern will be added to the list in Settings/Preferences → Editor → Language Injections.
Since it’s possible to inject languages into any string in the SQL code, we can use Check RegExp if we’re inserting a value for the MasterCard pattern.
Did you see this the ‘was temporarily injected’ tooltip? If you want to have the injection whenever you edit a particular piece of code, comment it with “language=” like on the following screenshot. In it is another important example — the use of DynamicSQL that provides coding assistance for the injected fragment.
Dumping Tables
Now you can dump multiple tables and even the entire schema, which means that any data (not only result-sets), can be exported to CSV, JSON or a list of INSERT/UPDATE statements.
Recompile objects in Oracle
We’ve fixed some bugs in recompiling packages and added a way to recompile any DB object. Well, it has to be recompilable, of course, like procedures, views, types, triggers, etc. There is a possibility to recompile only invalid objects in the group, too.
Ligatures
Just like any other IntelliJ-Platform-based IDE, DataGrip editor now officially supports fonts with programming ligatures. To enable ligatures, go to the Settings → Editor → Colors & Fonts → Font, specify a font that supports ligatures, e.g. FiraCode, Hasklig, Monoid or PragmataPro (the font has to be installed) and select the Enable font ligatures option.
And here you are!
That’s all for today. Stay tuned!
DataGrip Team
The Drive to Develop