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.
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.
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.
If you use the Docker plugin, the corresponding services will also appear in this tool window.
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.
where col @@ plainto_tsquery('text').
where match(col) against ('text' in natural language mode).
WHERE CONTAINS(col, N'text').
where col MATCH ‘text’.
If All columns mode is selected The search will look in columns that don’t support
LIKE operator, for instance, columns of JSON type. Values in these
columns are converted to string beforehand.
In Cassandra, DataGrip creates several queries for one table, because the
OR condition isn’t supported by the database.
Now, to define how many lines you want to retrieve from the database, you can do it from the result-set’s toolbar.
Another super-cool improvement for results: tab naming! Just use the comment before the query.
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.
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!
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.
Starting with version 2019.2, the small green light indicates if there is a live connection to the data source.
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.
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.
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:
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.
When you use
CASE constructions, DataGrip analyzes whether they can be
transformed into more readable ones.
We’ve added one more intention action: now you can convert
GROUP BY to
if all the columns of a
SELECT clause are presented in a
The IDE detects the length of the string when assigning a value to the variable, and warns you if it will be truncated.
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:
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.
If you want to improve the readability of big numbers, fold them with the shortcut Ctrl+Minus.