What's New in DataGrip 2019.2

Services tool window

All our IDEs now have a new tool window called Services. In DataGrip, you can observe and manage all the connections there.

Every connection has its own node under the corresponding data source. If the small green light on the icon is on, it means that the connection is live. You can easily close a connection by using the context menu.

You can view all the service types as nodes, or alter the view to see them as tabs. Use the Show in New Tab action from the toolbar, or simply drag the node you need onto the title bar of the Services tool window.

The query result is now attached to the particular console under its connection in the Services view.

Important! The default shortcut for Services tool window is Alt+8.

Hiding the tree

Hiding the tree

If you don’t want to see the Services tree (that is, you want to go back to how it was before), click the gear icon and hide it.

Query live timer

The Services tool window also provides you with another requested feature: a query live timer. For any connection that runs a query, look to its right-hand side to see how much time it took.

Docker

Docker

If you use the Docker plugin, the corresponding services will also appear in this tool window.

Full-text search

Now you can search for data even if you don’t know where it is located. To do this, select the data sources, groups of data sources or even separate tables you want to search through and invoke Full-text search from the context menu. Of course, there is a shortcut for this as well: Ctrl+Alt+Shift+F.

You will see a dialog to enter the string into. You will see the list of data sources to search through, and you’ll be able to set some options for your search.

In addition, you can see which particular statements DataGrip will run to perform the data search.

After running the search, you’ll see the results which you can open.

Click on a result to open the data editor. The filter will be pre-defined to give you only those strings where the data is found. If you cannot locate the data because there are too many columns, use text search in the data editor with Ctrl+F.

In some databases you can choose to search only in columns that are indexed. To use this mode, select Only columns with full-text search indexes in the Search in drop-down menu.

  • In PostgreSQL, the query will be: where col @@ plainto_tsquery('text').
  • In MySQL and MariaDB, the query will be: where match(col) against ('text' in natural language mode).
  • In Oracle, the following indices are used, if they exist: context, ctxrule, ctxcat.
  • In SQL Server, if there are columns with fulltext indexes, DataGrip generates queries with WHERE CONTAINS(col, N'text').
  • In SQLite, DataGrip generates queries with where col MATCH ‘text’.

If All columns mode is selected The search will look in columns that don’t support the LIKE operator, for instance, columns of JSON type. Values in these columns are converted to string beforehand.

In Apache Cassandra, DataGrip creates several queries for one table, because the OR condition isn’t supported by the database.

Data editor

The page size is easy to change

The page size is easy to change

Now, to define how many lines you want to retrieve from the database, you can do it from the result-set’s toolbar.

The results tabs can be named

The results tabs can be named

Another super-cool improvement for results: tab naming! Just use the comment before the query.

The results tabs can be named

 

If you only want certain comments to become tab names, use the Treat text as title after field in the settings to specify the prefix word. Then only the words coming after that word will be used as titles.

Database tree view

Quick table backup

Quick table backup

It was possible to copy tables via drag-n-drop, but it didn’t work when copying to the same schema. In fact, this could be very handy if you ever needed to create a quick backup of the table before any crucial data manipulations. So we’ve now made it work!

Quick group creation

Quick group creation

Now, drag-and-drop also works for creating groups in the database explorer.
To create a new group, just drag one data source onto the other.
To place the data source into an existing group, drag-and-drop it there.

Live connections

Live connections

Starting with version 2019.2, the small green light indicates if there is a live connection to the data source.

Force Refresh

Force Refresh

A new action is available for the data source or schema, called Force Refresh. It clears the data source information that DataGrip caches, and refreshes it from scratch.

Filtering by a data source in search and navigation

When you are locating an object in the GoTo popup, sometimes many similar objects are present in the list. It frequently happens when you have many mirrors such as production, staging, test, and so on.

In DataGrip 2019.2, you can choose where to search: in a specific data source or in a group of them.

The same works for Find In Path, which is extremely useful when searching for source code inside of other objects’ DDLs.

Coding assistance

The page size is easy to change

Objects from system catalogs

In nearly every database there is a system catalog – the place where a relational database management system stores schema metadata, such as information about tables and columns, built-in functions, etc.

Objects from these catalogs are needed to provide coding assistance. It’s nice to have them in code completion, and code that uses them should not be red.

Before, the only way to have system catalogs in coding assistance was to add them to the database explorer. DataGrip actually retrieved information about them from the database (always the same, by the way!), which took time. Also, they were visible in the database explorer, which is not always necessary.

This kind of schemas have a lightning icon in the schema chooser. Now, if you don’t check them, DataGrip will not introspect and show them, but will use the information about their objects in coding assistance. To make this possible, DataGrip uses its internal data about system catalogs for each database.

Some examples of system catalogs for several databases:

  • PostgreSQL: pg_catalog, information_schema
  • SQL Server: INFORMATION_SCHEMA
  • Oracle: SYS, SYSTEM
  • MySQL: information_schema
  • DB2: SYSCAT, SYSFUN, SYSIBM, SYSIBMADM, SYSPROC, SYSPUBLIC, SYSSTAT, SYSTOOLS
The page size is easy to change

Intention-actions and quick-fixes

First, we’ve integrated a quick-fix into the inspection tooltip. If DataGrip knows how to fix the problem, you will know about it by just hovering the mouse over the warning. To fix the problem, just click the link at the bottom left corner of the tooltip, or press Alt+Shift+Enter.

Alt+Enter still works for getting the list of all the possible quick-fixes.

We’ve also introduced several new inspections.

Unnecessary usage of CASE

When you use CASE constructions, DataGrip analyzes whether they can be transformed into more readable ones.

To an IF:

 

To an COALESCE:

GROUP BY to DISTINCT conversion

GROUP BY to DISTINCT conversion

We’ve added one more intention action: now you can convert GROUP BY to DISTINCT if all the columns of a SELECT clause are presented in a GROUP BY clause.

Possible truncation of the string

Possible truncation of the string

The IDE detects the length of the string when assigning a value to the variable, and warns you if it will be truncated.

SQL editor

New option to control the behavior of Move Caret to Next Word

New option to control the behavior of Move Caret to Next Word

The default behavior of the Move Caret to Next Word action has changed: DataGrip will move the caret to the end of the current word.

To change the behavior of the caret movement actions, go to Preferences/Settings | Editor | General.

People usually perform this action by pressing Ctrl+Arrows on Windows and Linux and Opt+Arrows on Mac. It has a different default behavior on different operating systems. In Datagrip, we’ve changed the Windows-like behavior to the Mac-like one.

This is how it was before:

And now it’s like this:

GROUP BY to DISTINCT conversion

Select current statement

A new action, Select current statement, is now available. You can get to it from Find Action Ctrl+Shift+A or assign it a shortcut of its own.

Possible truncation of the string

Folding of big numbers

If you want to improve the readability of big numbers, fold them with the shortcut Ctrl+Minus.

Other changes

  • DataGrip 2019.2 runs under JetBrains Runtime 11, the uncertified fork of OpenJDK 11, by default.
  • If you want to see comments for tables in the tree view, go to View | Appearance and toggle the Descriptions in Tree Views option.
  • [Apache Cassandra] You can now edit these types of columns: set, list, map, tuple, udt, inet, uuid, and timeuuid.
  • New combined items are now included in code completion: IS NULL and IS NOT NULL.
  • The option Jump outside closing bracket/quote with Tab is enabled by default.
  • The option Surround a selection with a quote or brace is enabled by default.
  • Introduce alias has been added to the refactoring menu.
  • DataGrip works with PostgreSQL 12: DBE-8384.
  • There was some inconsistency when working in read-only mode: if you wanted to run an update query from the read-only mode, the IDE turned off only the IDE-level mode, but not the JDBC one: DBE-8145. Now though, we turn off both so you can run the query if you really need to.