Import/Export options

Import CSV files

There is a dedicated UI for importing DSV (CSV and TSV) files to the database. Click the schema you wish to import data to, and choose Import From File… from the context menu. Then select the CSV file where your data is.

You will see the Import dialog window. The left-hand panel is for format specification: choose the delimiter, whether the first row is the header (the separate format options are available for it), and specify if you have quoted values in the file.

On the right-hand side, you see the frame describing the table to be created and the result data preview. Press Delete to remove a column from the result. If you want to import data to an existing table, just use the context menu of this particular table to choose Import From File…

What happens if there are errors in the file? Write error records to file option is available. The import process will not be interrupted, but all the wrong lines will be recorded into this file.

CSV editor

DataGrip can edit CSV files as tables. Click on Edit As Table in the context menu.

Then choose the delimiter, specify if the table has a header, when to quote values, etc. An instant table preview is available.

Export data

Export as HTML.

Any table or result-set can be exported in a bunch of formats. Choose the appropriate Data Extractor from the context menu.

You can dump multiple tables and even the entire schema to file.

Export as JSON.

And even as any custom format based on DSV. For instance, it can be Confluence Wiki Markup.

UPDATE statements generation

Any table or result-set can be presented as a batch of UPDATE statements, which can help you modify data.

INSERT statements generation

It can be also presented as a batch of INSERT statements. In some situations it can be faster than writing a INSERT+SELECT query for adding data to another table. Note that this generation is aware of auto increment IDs.

Edit INSERTs as table

It frequently happens that you have multiple INSERT statements referring to the same table in one script. DataGrip lets you modify this data as a table and even add INSERT statements as rows of this virtual table, which is editable.