What's New in DataGrip 2022.1

DataGrip 2022.1, our first major update of 2022, is here. It’s packed with various enhancements and improvements for a better usability. Let’s take a look at what’s inside.

Import/Export

Copy multiple objects

This is undoubtedly the highlight of this release. You can now select multiple tables and copy them to another schema.

Select the tables you want to copy and press F5 to open the export dialog.

Like with exporting a single table, you can map the columns, as well as view and change the DDL of the new table.

 

As you may know, DataGrip supports cross-DBMS export, which means that the target schema can belong to any database in your project. Copying all tables from your PostgreSQL database to SQL Server is easy as pie.

You can also specify an existing table, instead of a new one, as the target. If you do that, the data from the source table will be added into the target table.

Quality improvements

  • DBE-5200: The Edit as table action now works correctly even when the rows in the source file have a different number of columns.
  • DBE-14541: Adding a row to a one-column CSV file now works correctly.
  • DBE-14735: Fixed the bug with simultaneous export of tables containing timestamps.

Data editor

Default display format for binary cells

We’ve added a new setting, Automatically detect binary values, with two options: UUID and Text. UUID detection can now be disabled.

Editing fields in query results MongoDB

You can now edit the results of queries to MongoDB collections right from a console. This will work even if .find() is followed by methods like sort() or limit().

Support for in-editor results in batch mode SQL Server

When multiple statements are run concurrently in Transact SQL, they are executed in batch mode. Previously, this made it difficult to show in-editor results for each query, but now DataGrip handles this situation well.

In addition, DataGrip now removes all SQLCMD statements when running queries in batch mode (see DBE-14920 for details).

Quality improvements

  • DBE-8561: Clicking outside the date picker no longer results in lost changes.
  • DBE-9632: The Enter key now works for saving the value in the date picker.
  • DBE-11706: The Tab key is now supported in the date picker.
  • DBE-9974: It’s now possible to disassociate a .csv file from ‘View as Table’.
  • DBE-13040: We’ve made it easier to display hidden columns – simply click on a hidden column in the column list.
  • DBE-14516: The cell size indicator is no longer displayed for fully loaded values and uses monospaced font, so the content is aligned neatly.
  • DBE-14670: The Geo viewer now syncs correctly.
  • DBE-10851: We’ve fixed a font issue in tree view mode.
  • DBE-9710: Oracle Timestamp values now respect time zones.
  • DBE-14852: MariaDB, Aurora MySQL Blank dates are now correctly displayed in the data editor.
  • DBE-15009: Sybase ASE All columns are now shown in the result view.
  • DBE-15031: Snowflake The update query for tables with DEFAULT values is now generated correctly.
  • The context menu of the column is now also displayed in the Transpose view.

Introspection

Session templates for introspection

Sometimes introspection requires special permissions, which are granted to special users. It’s now possible to use dedicated credentials for introspection. To do this, first create a dedicated session template in the Options tab.

 

Then, use this template for the introspection by selecting its name in the Use session template field in the Introspection section.

Fragmental introspection Oracle

You can now refresh an object independently of all other objects in the database.

 

This can be especially useful if you are using our new Introspection levels feature. If you need to view the source code of just a single object, you can easily do so by clicking on the Refresh Object button in the database explorer.

Also, when you open the object’s source editor, DataGrip will offer you the option to introspect the selected object.

Support for version 2.x H2

We've added support for H2 version 2.x. Here's the list of changes:

  • DataGrip now correctly introspects types. Most of the issues were related to the composite types: ARRAY and ROW.
  • Columns with built-in sequences (auto_increment, generated always as identity, etc.) are now introspected correctly.
  • Check constraints and foreign keys are no longer lost.
  • The sources are loaded for views, triggers, routines.
  • Information about check-predicates is displayed for domains.

Added to basic support YugabyteDB

We’re now shipping the JDBC-driver for YugabyteDB, and you can create a YugabyteDB data source with just a single click.

Quality improvements

  • DBE-13521: ClickHouse The source code of materialized views is now introspected.

Code generation

New version of Modify Table

We are slightly reworking the Modify Table window. The new version will have a fully generated UI based on introspective properties, which will allow it to have a variety of database-specific parameters.

For now we are releasing only a small portion of the update, but it can already be uniquely useful. The new Modify Table window lets you add and edit column check constraints, which was previously impossible! Also, you can now edit all the properties of tables and columns that are introspected by DataGrip.

We think you will particularly appreciate the new UI for columns because there is no collapsing or expanding, which many users found frustrating.

Quality improvements

  • DBE-15000, DBE-15001: PostgreSQL The correct code is now generated when editing grants.
  • DBE-5136: SQL Server You will now get a valid script when removing columns with constraints via Modify Table.
  • DBE-14760: MySQL The Modify Table window no longer corrupts the functional index.
  • DBE-2827: MySQL It's possible to modify the AUTO_INCREMENT attribute.
  • DBE-14801: Snowflake The generated DDL script contains statements for creating the default sequences.

Database diff viewer

Swap source and target

We've introduced a button that lets you swap the source and the target when comparing objects or schemas.

Quality improvements

We’re constantly improving the quality of our recently introduced database diff viewer window. Some fixes were released in version 2021.3, but some are new in 2022.1, including:

  • DBE-15063: The new smart algorithm for string comparison solved the problem where keyword casing was respected in the diff window.
  • DBE-14686: The Reformat generated code option is respected.
  • DBE-14782: The diff viewer detects objects that are likely to be the same even if their names are different.
  • DBE-14431: Oracle The Array index out of bounds exception should no longer occur.

Code editor

Convert to subquery intention

We’ve introduced a handy new intention, Convert To Subquery. You no longer need to use Surround Live Template to convert subqueries. In fact, you don’t even need to bother selecting a query. Simply press Alt+Enter | Convert To Subquery.

Better auto-indent algorithm

We’ve improved the auto-indentation algorithms. There were a couple of tickets related to this, DBE-14825 and DBE-8742, but we went a lot further and considered all possible situations and cases, so auto-indentation should now work correctly just about everywhere.

Multirange types supported PostgreSQL

Multi-range types were introduced in PostgreSQL 14 – we’ve added support for the built-in ones.

Custom multi-range types will be supported in the future.

Quality improvements

  • DBE-11683: PostgreSQL Added support for ROWS FROM syntax.
  • DBE-11868: PostgreSQL Fixed a problem resulting in unresolved common table expressions.
  • DBE-15061: PostgreSQL Fixed the problem causing the incorrect injection of JSONB syntax.
  • DBE-14888: PostgreSQL Added support for BEGIN ATOMIC.
  • DBE-15052: Redshift Added support for ALTER MATERIALIZED VIEW.
  • DBE-11830: Oracle Added support for USING INDEX ENABLE syntax.
  • DBE-6548: Oracle Fixed column resolve in CREATE MATERIALIZED VIEW LOG statements.
  • DBE-15095: Snowflake Added support for the WITH TAG option in the CREATE STAGE statement.
  • DBE-14793: Snowflake Added support for the EXECUTE statement.
  • DBE-11247: Snowflake JSON is now correctly highlighted inside statements.
  • DBE-14843: BigQuery QUALIFY is now supported.
  • DBE-13995: BigQuery UNNEST column is now supported.
  • DBE-14504: ClickHouse Map literals are now supported.
  • DBE-15013: ClickHouse UNION DISTINCT is now supported.

Running queries

Canceling running statements

Previously, when you clicked the Cancel statement button several times, it looked like the query was terminated, but in fact the request continued to be executed in the database.

There was some tricky logic behind this behavior. On the first click, DataGrip sent a cancellation request to the database, while on the second click it canceled the JDBC Driver process to terminate all connections to the data source (we’ll refer to this as data source deactivation). As a result, DataGrip received an error for the second cancellation request because the connection was lost, not because the cancellation was actually completed.

We’ve now made the cancellation logic more straightforward. Hopefully, it’s now clearer that it’s the request that is being canceled:

  • The progress indicator on the gutter shows a red square while the request is being canceled.
  • A cancellation progress bar is displayed. It identifies the data source and the session.

We no longer deactivate data sources without a warning, as that can be potentially dangerous for some processes happening simultaneously. So, if you click on the Cancel icon a second time, DataGrip will ask you whether you really want to kill the remote process or whether you’d like to keep waiting. If you choose to deactivate the data source, the query will be stopped for DataGrip, but it will continue to be executed in the database.

After 10 seconds of idle canceling, you’ll be offered the option to deactivate the data source anyway.

After the query is canceled, a gutter icon that resembles the ‘No’ symbol will appear to the left of it.

Canceling connections

Previously, when you attempted to abort a request while creating a connection, the data source was deactivated.

Now you can interrupt not only the execution of a request, but also the creation of a connection. This is especially relevant for the very first query in the console, which also creates a connection.

You can now stop the process of creating a connection without deactivating the data source: if you click the Cancel button while the connection is being created, it will be stopped and a Connection canceled message will be displayed.

This is relevant for more than just queries from the query console. For example, if you create a connection before starting an introspection, interrupting the introspection will cancel the creation of the connection without deactivating the data source.

IDE General

Reworked settings

The structure of the Preferences settings for the Database section hasn’t changed since the first version of DataGrip. We decided it was time to improve the section’s usability by updating the structure. Here’s what we’ve come up with:

The Track databases/schemas creation and deletion setting has been moved from the General section to Data Source Properties | Options and now refers to a specific data source. This setting identifies whether the schema list needs to be updated after you create or delete schemas in the query console.

Other settings are still global but are now included in more appropriate sections.

Please note that as part of this update, these settings will be reset to their default values:

  • Data Source properties | Track databases/schemas creation and deletion – True.
  • Editor | General | Editor Tabs | Database | Always show qualified names for database objects in tab titles – False.
  • Editor | General | Editor Tabs | Database | Shorten datasource and object names in tab titles – True.

Evenly split tabs

You can now distribute the working space among editor tabs so that they are the same width. To set this up, go to Settings / Preferences | Advanced Settings | Editor Tabs | Equalize proportions in nested splits.

Export UML diagram to other formats

It is now possible to export diagrams as yEd .graphml, JGraph .drawio, Graphviz .dot, Graphviz .dot with positions, Mermaid .md, Plantuml, and IDEA .uml files, which makes them compatible with third-party tools.

Quality improvements

  • DBE-15043: Bookmarks now provide the same navigation behavior as database explorer items.
  • DEA-129631: Fractional font sizes are now supported.