Back to JetBrains

DataGrip Overview, Part 7: Exporting Data

JetBrainsOctober 14, 20262m
In a Nutshell

DataGrip lets you export any table or result set using selectable extractors that control the output format—CSV, SQL INSERT statements, WHERE clauses, or fully custom scripts. The same extractors power clipboard copies, so you can paste data directly as INSERTs or WHERE filters without manual formatting. A “Copy to Database” button turns any result into a new table in another database, making quick backups or migrations a single click.

AI-Generated Notes

These notes were generated by AI and may contain inaccuracies.

Any open data network, whether it's a table or a result set, can be exported in many different formats. In the menu on the toolbar, there are data extractors that specify the data export format. The CSV extractor is one of the most common extracts. The extractor determines the output file format. If you select the CSV extractor from the list, after clicking on Export File, that extractor will be selected beforehand and you will get a CSV file as the output.

Extractors are also used when copying data. Selecting the CSV extractor and copying specific data will result in the CSV extracted format being placed in the clipboard. The SQL insert extractor creates SQL insertion statements when data is copied. Selecting this extractor, selecting some data, and pressing copy will apply the SQL insert extractor format to the clipboard. When pasting this data elsewhere, it appears as a set of insertion statements.

The "where clause" extractor creates a "where" clause and pastes it into another query. This is extremely convenient, as you no longer need to do it manually.

Some data extractors are called software extractors, meaning they are just scripts. These scripts can be updated or edited, and custom extracts can be shared.

The "Copy to database" button allows exporting any table or set of results to a new table in any database. For example, after running a query, the result can be exported as a table in a PostgreSQL database. Clicking on "Copy to Database" and selecting the desired data source and schema provides a preview of the Data Definition Language (DDL) for the table that will be created. After confirming, the new table appears in the PostgreSQL database.

This feature allows easy visualization of any set of results, which is particularly useful if they are retrieved after a very long query. The ability to copy tables is also useful for creating small backups. Dragging and dropping the "actor" table onto the same chart creates an identical copy. After confirming, the backup schedule for "actor" is created.

Keep JetBrains in your library

Save the videos and channels worth coming back to, and find them again in one place.