DataGrip 2024.2 Help

Release notes

This section lists functionality added to DataGrip in the current release. To view release notes for other DataGrip versions, click the version switcher on the help site and select the version that you need.

Release notes

AI Assistant features

Text-to-SQL

AI Assistant can now generate SQL code in the editor. To use this feature, press Ctrl+\, or click the Generate Code with AI icon Generate Code with AI on the editor toolbar, and enter your prompt. For example, Add queries that will create a books table and populate it with three sample rows.

Entering the prompt in the editor

After the assistant generates the code, you can accept the result, regenerate it, or specify your prompt by clicking the corresponding buttons at the bottom of the suggestion pane. You can also take the generated code to the AI chat to ask AI Assistant any questions you may have about the code.

Generated code in the editor

Mentioning database objects in AI Assistant chat

You can attach your database schema to the AI Assistant chat by mentioning it in your prompt. To do that, enter your prompt with # followed by the schema name. For example: Give me a query to get all actor names from #public.

Attaching database schema to AI chat by mentioning it in the prompt

AI Assistant will analyze your schema and generate the result.

AI generated code for the entered prompt that mentioned a schema

Mentioning files in AI Assistant chat

You can also mention files from the attached folder, which is useful when you want to provide a particular script to AI Assistant as context.

AI generated code for the entered prompt that mentioned a schema

Explain and fix SQL problems using intention actions

Now, you can use AI Assistant help to better understand and fix SQL problems. For any problems higher than Weak warning, the assistant now suggests an explanation and a fix.

To get an explanation, invoke the intention actions by selecting the highlighted code and pressing Alt+Enter, selecting AI Actions, and then Explain SQL problem under caret. AI Assistant will provide the explanation in the chat.

AI Assistant explains problems in the selected SQL code

To fix the problem, in the AI Actions popup window, select Fix SQL problem under caret. AI Assistant will replace your SQL code with the corrected code.

AI Assistant generates a fixed code

This feature can require attaching the database schema to suggest proper explanations and fixes.

Modify tables

AI Assistant can now help you with modifying tables. To get the assistance, in the Modify dialog, click the AI Assistant icon AI Assistant to invoke the AI Assistant dialog. In the dialog, ask the AI Assistant to do what you need. For example, Switch all the VARCHAR data types to CHAR.

AI Assistant generated code for modifying a table

Once AI Assistant generates the resulting code, you will be able to view it in the preview pane of the dialog.

Working with data

Scripted data loaders

You can now import the data from your tabular data files. We have implemented the scripted data loaders to enable importing for the following file formats:

  • Excel

  • JSON

  • Parquet

  • Shapefile

To add custom scripted loaders, place them in their specific directory in Scratches and Consoles | Extensions | Database Tools and SQL | data | loaders.

To import the data, drag your file from the Files tool window to the schema in Database Explorer, and configure the import settings in the Import dialog that opens.

Import dialog for importing data from an Excel file

Additionally, DataGrip can now display the contents of your tabular data files in the data editor. To open the files, click them in the Files tool window . To disable the feature, go to Settings | Advanced Settings, find the Open file as table if detected by scripted loader setting, and select None.

Contents of an Excel file displayed in data editor
Contents of a JSON file displayed in data editor

Geo Viewer for tabular data files

You can now use Geo Viewer to view the geospatial data stored in tabular data files (CSV, XLSX, etc).

For more information about Geo Viewer, refer to View geographical data.

Geographical data from tabular data file in Geo Viewer

Now, you can navigate to related records by using the table cell's floating toolbar. To do that, click the cell and then click the Related Rows icon Related Rows icon on the floating toolbar that appears.

Floating toolbar for grid cells

To remove the action from the floating toolbar, open the toolbar, click the More icon More, and then select Customize This Toolbar. In the Customize Grid Floating Toolbar dialog, select the action, and click the Remove icon Remove. You can restore the action in Settings | Appearance & Behavior | Menus and Toolbars by selecting Grid Floating Toolbar and clicking Add.

You can set the action behavior using the Related Rows action behavior setting. To do that, navigate to Settings | Advanced Settings. The Navigate and select first option will select the first referenced rows and show all the rows in the table. The Navigate and filter all one will show the referenced rows only.

Now, you can open web links and file URIs using the corresponding actions in the floating toolbar of selected cell.

  • Click the Open URL icon Open URL to open URLs in OS default web browser.

    Default action in floating toolbar for URLs
  • Click the Open File URI icon Open File URI to open file URIs in OS default file browser.

    Default action in floating toolbar for file URIs

By default, the features are disabled for security reasons. To enable them, navigate to the Database | Data Editor and Viewer page of settings  Ctrl+Alt+S and select the corresponding settings in URL Click Settings section.

Automatic value completion

The cell value completion in the data editor is now automatic. Note the completion is local, so its options are based on the current column's other values that have already loaded.

For more information about using the completion, refer to Use value completion.

Selecting columns

Now, it's possible to select all values in a column by clicking the column’s header.

The functionality to sort values in a column is still available. You now need to click the corresponding icon to sort the column’s values.

Search Everywhere popup

Filtering

You can now filter search results in the Database tab in the Search Everywhere popup by the database object type. There are two ways to do this.

  • Use the filter icon in the upper-right corner.

    Database object type filter in the Search Everywhere popup

    The names of object types by which you can filter results include:

    • Databases & Schemas: database, external-database, external-schema, schema.

    • Tables: table, view, materialized-view, virtual table, foreign-table, and others.

    • Scripting: function, stored procedure, aggregate, package, partition-function, and others.

    • Types: alias-type, collection-type, object-type, table-type.

  • Enter / followed by the object type and then the object name.

    For example, entering /tables will result in a list of introspected database tables, and /tables film will find the tables that have film in their names.

    the Search Everywhere results filtered by database object type and name

Preview

The Search Everywhere popup now includes an option to preview the codebase elements you are searching for. Preview pane offers additional context when you navigate through your project. To see the preview pane under the search results, click the Preview icon Preview on the toolbar.

Codebase elements preview in the Database tab

Better scopes

  • In the scope selector, data sources are now at the top of the scope list.

    Data source scopes on the scopes list
  • In the Text tab, a new Cached Database Sources scope was added.

    In this tab, you can search inside the source code of your databases' functions, views, and so on.

    Searching in the source code of databases using the Cached Database Sources scope

For more information about the Search Everywhere feature, refer to Search Everywhere.

Connectivity

Smart refresh

The Auto sync setting works differently for Oracle and Microsoft SQL Server. After a DDL statement is executed, DataGrip analyses which objects could be potentially modified by the statement and only refreshes the set of these objects instead of refreshing the whole schema.

For more information about the setting, refer to dialog reference topic.

IDE macros for connection startup scripts

You can use the IDE built-in macros in your connection startup scripts.

To add a macro to your script, open the Data Sources and Drivers dialog (Ctrl+Alt+Shift+S) , select your data source and open the Options tab. Navigate to the Startup script field and click Insert Macros.

Built-in macros selector for the connection startup script

Non-RSA certificates support

Non-RSA certificates are supported for SSL connections.

[Snowflake] Support for Iceberg, dynamic, and hybrid tables

Iceberg, dynamic, and hybrid Snowflake tables are now introspected and displayed in Database Explorer.

For more information about Snowflake data sources, refer to Snowflake.

Dynamic tables in Database Explorer
Last modified: 01 August 2024