What's New in DataGrip 2017.1

Database tree

New schema management

Now the schema selection UI is a tree with the ability to choose if you want to introspect the current schema/database or, all schemas/databases. ‘Schemas...’ node in the database view will also show this tree.

The Schemas tab comes back to the data source properties dialog. We added the Pattern field where you can describe what you want to be introspected. The Ctrl+Q shortcut will give you information about the syntax.

Variadic templates

SQL resolution scopes

As you know, DataGrip resolves objects from SQL code to your database. It means that the IDE understands which particular object you use in your script, and provides navigation, code completion and everything else that we are proud of. But previously this process incurred some difficulties if objects in code were unqualified. For instance, if your script contained just table names without schemas or databases, and there were two identical data sources, test and production, then the situation would become confusing.

Now, you can simply map any file or folder to any datasource in Settings → Database → SQL resolution scopes. This means that all unqualified objects will be resolved to the selected datasource/database/schema. The project level mappings are the same as Options → Resolved unqualified references in previous versions. All your settings set there will transit here, so you won’t lose them.

Variadic templates

Create database/schema UI

Many of you asked us to implement some simple UI for creating schemas and databases. Voila!

Decide if you want these new schemas and databases to be introspected immediately. This also applies to creating and deleting schemas/databases from the query console.

NB! As we still do not support several databases for PostgreSQL, any database created in this UI will not appear in the database tree, even if this option is enabled. Please create another data source to manage your new database.

New options in color settings

Data source color (Context menu → Color settings) now affects the console and result tab toolbars. It can even be applied to the editor and grid as well. We hope this will help you avoid running test scripts on your production databases.

SQLite better introspection

We introduced a small database tree improvement for SQLite users. In earlier versions, we used the introspection provided by JDBC-driver for SQLite. As a result, many objects were absent in the database tree and some source codes were incorrect. Now we show triggers, expression indexes, partial indexes and check constraints.


Import/Export data

Variadic templates

Column mappings and DDL preview

We’ve been asked to make the import process more flexible. It frequently happens that the number of columns in a .csv file is not the same as in the target table. Or you just want to import several columns from a file but not all of them. Now it’s possible to map every column of the file being imported to a table column in your database, which can be either an existing table or a new one created during the import process. Of course, completion works for column names.

Another new thing in this window is a DDL preview tab, showing you the code to be executed for creating or changing the table.

Export/import tables

Now there is an easy way to export tables and their data from one database/schema to another. It works even if the tables are in different databases from different vendors. For example, if you need to copy a table from a PostgreSQL database to a SQL Server database, just drag-n-drop it. Check if all is OK in the Import table window and go ahead!

The same for result-set! We added a button Export to database. Choose any schema in the list and go ahead: the new table is created, the data is inserted.


Query console

Respect the default search path

The most important for PostgreSQL users: now DataGrip respects the default search path. Before, we set the search path according to the context of the console opening. At some point we discovered it wasn’t very convenient for many of you. Now the default search path is set for any console. Change it in any moment or go back to the default one.

Better trigger support

A trigger template has been added to the Generate menu, which is invoked with Ctrl+N.

The IDE supports NEW/OLD and INSERTED/UPDATED tables when creating or editing triggers. This means you can use completion for these tables’ columns as well.

Smart SQL keys

We’ve added an SQL section to Settings → Editor → Smart Keys.

The Insert string concatenation on Enter option lets you choose if you actually need this. It was the default option before, and it works like this:

But the majority of database management systems support multiline string literals, so this IDE behavior may be annoying. Uncheck the option if you use multiline literals.

Qualify object in completion is also a thing we’ve been asked to implement. There are three options and here’s how they work. Suppose we have two schemas, max and public:

The table persons is present in both schemas and the table cardvendors is only in max. Here is the example of Qualify on collisions:

INSERT statement column names name hints

Try enabling Settings → Editor → Appearance → Show parameter name hints: DataGrip will prompt you about column names in INSERT statements.

Options for alias casing

Aliases casing now can be set in Settings → Editor → Code style → SQL. Aliases are offered in code completion.

Named parameters completion

Named parameters of routines can be completed by using second completion (pressing Ctrl+Space twice).

Statement separators

The general platform setting in Settings → Editor → Appearance → Show method separator now draws a line between statements.

Jump to colors and fonts

A small helpful action for those who don’t want to wade through colors and fonts settings to find a single thing they need. For now it is only available in the Find Action menu (Ctrl+Shift+A), but as usual, you can assign any shortcut to it.

This action will navigate you to the settings which are relevant to the context under the caret. If there are several of them, just choose one.


Database objects

Modify table UI improvement

The column details in the Modify Table dialog are now opened by double-cliсk. We changed it based on your negative feedback on single-click opening.

Tracking source code changes

Sometimes you make changes to the source code of some object, but forget to apply them. If you modify such an object in some other place in DataGrip, the source code editor will alert you.

Documentation link for system tables

The quick info pop-up (Ctrl+Q) for PostgreSQL system tables now contains the link to the documentation page at postgresql.org.

SQLite views

Also, now DataGrip loads the correct source code for views in SQLite. Before it was CREATE table code.


Miscellaneous

More information in result-set status bar

Some information was added to the status bar of the data editor. It is query time and selected column/row numbers under the cursor.

Text occurrences in Find Usages

Also, we have a new option to include or exclude text occurrences in Find Usages.

If it’s selected, results will include comments, occurrences in text files and string literals.


Other Improvements