# Data loaders

Procedure: Enable the Database Tools and SQL plugin

This functionality relies on the  Database Tools and SQL plugin, which  is bundled and enabled in IntelliJ IDEA   by default. If the relevant features are not available, make sure that you did not disable the plugin.

> **Note:**
> Database Tools and SQL functionality support is limited in IntelliJ IDEA without the Ultimate subscription.

1. Press `Ctrl+Alt+S` (Windows), `⌘ Comma` (macOS), `⌘ Comma` (IntelliJ IDEA Classic (macOS)), `⌘ Comma` (macOS System Shortcuts), `Ctrl+Alt+S` (XWin), `Ctrl+Alt+S` (GNOME), `Ctrl+Alt+S` (KDE), `Ctrl+Alt+S` (Emacs), `Ctrl+Alt+S` (Sublime Text), `⌘ Comma` (Sublime Text (macOS)), `Ctrl+Alt+S` (NetBeans), `Ctrl+Alt+S` (Visual Studio), `⌘ Comma` (Visual Studio (macOS)), `Ctrl+Alt+S` (Eclipse), `⌘ Comma` (Eclipse (macOS)) to open settings and then select `Plugins`.

2. Open the Installed tab, find the Database Tools and SQL plugin, and select the checkbox next to the plugin name.

Data loaders are specialized scripts that allow you to import your tabular data files into a database. They also enable the visual representation of this data in the data editor. The view of such files in the data editor is read-only.

* Data display in data editor. For example: 1. Excel ![Contents of an Excel file are displayed in the data editor](https://resources.jetbrains.com.cn/help/img/idea/2026.2/tabular_data_file_data_in_data_editor_excel.png) 2. JSON (disabled by default) ![Contents of a JSON file are displayed in the data editor](https://resources.jetbrains.com.cn/help/img/idea/2026.2/tabular_data_file_data_in_data_editor_json.png) To enable the Data tab with table view for JSON files, in the Advanced Settings settings page `Ctrl+Alt+S` (Windows), `⌘ Comma` (macOS), `⌘ Comma` (IntelliJ IDEA Classic (macOS)), `⌘ Comma` (macOS System Shortcuts), `Ctrl+Alt+S` (XWin), `Ctrl+Alt+S` (GNOME), `Ctrl+Alt+S` (KDE), `Ctrl+Alt+S` (Emacs), `Ctrl+Alt+S` (Sublime Text), `⌘ Comma` (Sublime Text (macOS)), `Ctrl+Alt+S` (NetBeans), `Ctrl+Alt+S` (Visual Studio), `⌘ Comma` (Visual Studio (macOS)), `Ctrl+Alt+S` (Eclipse), `⌘ Comma` (Eclipse (macOS)) , set the Open file as table if detected by scripted loader to All. For more information about viewing data in data editor, refer to [Data editor and viewer](data-editor-and-viewer.html).

* Data import from a file to a database Import Source settings: ![Import tabular data file: Tabular data Source settings](https://resources.jetbrains.com.cn/help/img/idea/2026.2/db_import_tabular_data_format_source.png) Mapping settings: ![Import tabular data file: mapping settings](https://resources.jetbrains.com.cn/help/img/idea/2026.2/db_import_tabular_data_format_mapping.png) For more information about importing data from a tabular data file to a database, refer to [Import data from tabular data files](import-data.html#import_tabular_data).

To locate data loaders, open the  Project tool window  and navigate to `Scratches and Consoles | Extensions | Database Tools and SQL | data | loaders`.

## Custom data loader

You can also create and use your own scripted data loader that you can write in Groovy.

Consider starting your script with the following code line as an example:

```GROOVY
// IJ: extensions = json displayName = JSON tableFirstFormat=false
```

The keywords are as follows:

* `extensions`: List of the file extensions the loader works with. Uses `;` as a separator.

* `displayName`: Name of the custom loader.

* `tableFirstFormat`: Defines whether the format is [table-first](advanced-settings.html#open_tabular_data_file_as_table). Default: `true`.

In your script, also add a function that receives the following context: path to the file and the `DataConsumer` interface. For example, `loadJson`:

```GROOVY
LOADER.load { ctx ->
    loadJson(ctx.getParameters()["FILE"], ctx.getDataConsumer())
}
```

For the `DataConsumer` interface, definition is as follows:

```GROOVY
interface DataConsumer {
    void consumeColumns(String[] names, Class<?>[] types);
    void consume(Object... row);
}
```

* `void consumeColumns(String[] names, Class<?>[] types);`: This method takes in the column names as the `names` array and the corresponding data types for each column as the `types` array.

* `void consume(Object... row);`: This method takes in the corresponding cell values for each column as `Object`. Each time the `consume` method is called, it processes one complete row from the table.

For the examples of built-in data loader scripts, open the  Project tool window  and navigate to `Scratches and Consoles | Extensions | Database Tools and SQL | data | loaders`.

## Supported file formats

The supported file formats are as follows:

| Script | File format |
| --- | --- |
| Excel | `.xlsx`, `.xls` |
| JSON | `.json` |
| Parquet | `.parquet` |
| Shapefile | `.shp` |

## See also

### Reference

[Project tool window](project-tool-window.html) [Data Editor and Viewer](data-editor-and-viewer.html#reference) [Import dialog](import-data.html#import_dialogs)

### Related

[Data editor and viewer](data-editor-and-viewer.html) [Edit DSV files as tables](editing-csv-and-tsv-files.html)

### Procedures

[Import data from tabular data files](import-data.html#import_tabular_data)

