What's New in DataGrip 2016.2

Import CSV

Variadic templates

Instead of the way of importing CSV files with the help of Edit As Table, use our new user interface. It will help you to import CSV, TSV (well, DSV) files to the database.

Click the schema you want import data to, and choose Import From File… from the context menu. Then choose the CSV file where your data is.

You will see the Import dialog window. The left-hand panel is for format specification: choose the delimiter, whether the first row is a header (the separate format options are available for it), and specify if you have quoted values in the file.

On the right-hand side, you see a frame describing the table to be created and a result data preview. Press Delete to remove a column from the result. If you wish to import data to an existing table, just use the context menu of this particular table to choose Import From File…

OK, but what happens if there are errors in the file? Write error records to file option is available. The import process will not be interrupted, but all the wrong lines will be recorded to this file.


Adding Schemas

We've replaced the way schemas are selected from the tab in Properties, so now you will find all schemas of the server by clicking "More Schemas…" in the database view. Choose the schemas you want to see here and hide any you don't need from the context menu. Now you need to refresh your data source if you've updated from the previous version. Remember, that only schemas added to the database tree are available in code completion.


Language Injections

Auto-injection

Language Injections is the feature lets you treat string literals as live code written in other languages (like XML, JSON, any SQL dialect or regular expressions), including formatting, highlighting, usage search, completion, and even refactoring. Language is auto-injected into a literal when DataGrip understands the type of the string inside. For example, if you are inserting values into JSON column, 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+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.

Custom Type Injection

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. Notice that quick search is available here.

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 type 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.

Regular Expressions Checking

Since it's possible to inject languages into any string in the SQL code, we can use Check RegExp if we're inserting, for instance, a value for the MasterCard pattern. First, inject RegExp language to your string by Alt+Enter, then Alt+Enter again and invoke Check RegExp.

Dynamic SQL and Comment Injection

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.


Table Editor

Column Resize and Selection

We've added actions for resizing columns: use Ctrl+Shift+Left/Right. You can resize several columns at the same time. Ctrl(Cmd)+Shift+Up stands for the default size. Notice, that selection of the whole row was invoked by Shift+Space, like in Excel.

Completion for Values in Tables

Completion for values in table is available via Ctrl+Space. It looks through all the values in the column and offers you a list of possible matches.

Fields Editing

Some improvements have been made in PostgreSQL: now you can modify different range types and types with time zones.


Query Console

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. Fira Code, Monoid, PragmataPro or Hasklig (the font has to be installed) and select the Enable font ligatures option. And here you are:

Keyboard Layout Aware Completion

A small enhancement for those who use many languages, IntelliJ-based IDEs including DataGrip now understand what you mean, even if you forgot to switch the language of input.

Surround With Function

Surround action doesn't ruin multi-carets anymore. Also, we've added surround with function which means that the caret will be placed before the brackets, not after: put the name of the function here.

Variadic templates

Search Path Support

DataGrip now supports search path in PostgreSQL, meaning you can add schemas one by one in the switcher of the console. The console has a list of schemas to look in. If there are two tables with the same name in different schemas, the first one will be used. Thus, the order is important: move schemas in the search path with the mouse or Alt+Up/Down.


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.



Recompiling Packages

We've fixed some bugs in recompiling packages in Oracle and added a way to recompile any DB object. It has to be recompilable like procedures, views, types, triggers, etc. There is a possibility to recompile only invalid objects in the group, too.


Background Images

A small new feature will help you make DataGrip look different: set any image as the background of your IDE. Add the folder with the picture to the Files panel, and then choose Set Background Image from the context menu. Or just choose Set Background Image from Find Action by Ctrl+Shift+A.


Other Improvements

  • Fixed DBE-569: important bug with timed out connection on MySQL.
  • The Database tool window now provides the option Auto-scroll from Editor.
  • If you use auto-completion, in case of identical names DataGrip will qualify the name of the object automatically.
  • Added Tools → Create Command-line launcher/Create Desktop Entry actions in Linux.
  • Go to source works from the preview in Find in path.
  • Copying SSH and SSL settings copies the password as well.
  • *.sql files are associated with DataGrip on Windows and also can be opened from the "Open with" context menu.
  • CTE support has been improved — we parse it even not finished.
  • Inserting the selected keyword in completion by ";" and "," doesn't insert a space anymore.
  • Aggregate functions in ORDER BY are not highlighted as errors.
  • The same for PREVIOUS VALUE in DB2.
  • Test connection UI has been improved.