DataGrip Overview, Part 8: Importing Data
In a Nutshell
DataGrip provides a dedicated import interface for CSV and other file formats, allowing users to map source columns to destination table columns and customize formatting options like separators and quotes. The tool handles errors by logging problematic rows to a separate file without stopping the import process, and supports complex scenarios like importing multiple files to one table or one file to multiple tables. Users can create custom loaders for unsupported formats and perform quick imports by pasting clipboard data, which DataGrip automatically parses as CSV/TSV.
These notes were generated by AI and may contain inaccuracies.
There is a dedicated interface for importing CSV files into the database. Click on the chart you wish to import data into and select "Import from File" from the context menu. Then select the CSV file in which your data is stored. An import dialog box will appear.
The left side of the window displays the source and destination. In this case, the source is a CSV file. By clicking on it, you will see the types of data that DataGrip has detected and the format that will be used. You can modify the formatting if you need a specific setting for the quotes or value separators.
The destination is the table. Here, what you are defining is the column assignment. In other words, which columns from the CSV file should be inserted into which columns in the table. This is usually straightforward, but when importing into an existing table, some processing may be required.
What happens if the file contains errors? The option to "record errors in a file" is available. The import process will not stop, but all incorrect lines will be recorded in this file.
The real strength of the import mechanism lies in the possibility of having multiple sources or destinations. For example, you can import multiple CSV files into a single table. Or conversely, you can import a single CSV file into multiple tables.
It is also possible to import from other formats. If you drag and drop this Excel file onto your chart, it will open the import dialog. Here, when editing the source, you see the list of loaders. We call the file format a "loader" because the loader is the script that handles the file.
You can create your own loader. Like data extractors, loaders are stored in the extensions folder. You can access it through the temporary files (scratches) section in the File Tools window. As you can see, JSON, parquet and other formats are already supported. If you want something more specific here, add your loader here. You can take any of the existing loaders as an example.
You can also perform quick import operations simply by pasting the data. You can copy the data you need and then paste it anywhere in the editor. This actually works through the CSV file located in the clipboard. So, for example, if you have an external CSV file, you can copy and paste it into the DataGrip Data Editor. DataGrip attempts to automatically understand your clipboard format. However, if you wish to specify the CSV or TSV format in the clipboard, you can do so using the options under the gear icon.
Keep JetBrains in your library
Save the videos and channels worth coming back to, and find them again in one place.





