# Import SQL dump files

> For the complete documentation index, see [llms.txt](https://www.jetbrains.com/help/go/2026.3/llms.txt).

In this tutorial, we will learn how to run SQL dump files in GoLand.

For MySQL and PostgreSQL, GoLand supports dump tools.  For more information about using them, refer to  [Restore a full data dump for MySQL and PostgreSQL](import-data.html#restore-a-full-dump-for-mysql-and-postgresql)

## Before you start

Make sure that you have the following:

1. A running database instance ready to use.

2. In GoLand, a data source that can connect to your database instance.

3. SQL dump files.

For illustration purposes, in this tutorial we will use SQLite database, corresponding data source, and Sakila dump files.

> **Note:**
> In our case, structure dump and data dump are two separate SQL files, `sqlite-sakila-schema.sql` and `sqlite-sakila-insert-data.sql` respectively.

Where do I get those materials?
: 1. In SQLite, a database is a single file. GoLand will create the file automatically when you create the data source.
:
: 2.
:
: To learn how to create SQLite data source in the IDE, refer to the [SQLite](sqlite.html) topic.  For more information about data sources and instructions on creating data sources for other database vendors, refer to  the [Create a data source](managing-data-sources.html#create_a_data_source) chapter.
:
:
:
: 3.
:
: You can get the Sakila files by cloning the `dumps` repository.
:
:
:
:
: ```CONSOLE
: git clone https://github.com/DataGrip/dumps.git
: ```
:
:
:
: Note that you need to install [Git](https://git-scm.com/) to clone the repository.  For more information about installing plugins, refer to  the [Extend the IDE with plugins](managing-plugins.html) topic.  For more information about cloning repositories, refer to  the [Step 2. Clone a GitHub repository](github-add-cloned-repositories-and-share-directories.html#step-2-clone-an-existing-github-repository) step of a GitHub tutorial.

So, the initial state includes locally stored SQL dump files and a GoLand project with a data source.

![Start](https://resources.jetbrains.com/help/img/idea/2026.3/db_tutorial_run_dump_files_start.png)

In GoLand, there are several ways of running SQL files. We will take a detailed look at two of them:

* Run files in [Database tool window ()](managing-data-sources.html) . In this case, you will use a context menu of a target schema to navigate to and select your dump files in your file browser. You can run any dump files that are accessible to you, no special association to GoLand project is required. This case is preferable if your dump files aren't attached to your GoLand project. For example, if you only need to run your files once.

* Run attached files in Project tool window (`Alt+1` (Windows), `⌘ 1` (macOS), `⌘ 1` (IntelliJ IDEA Classic (macOS)), `⌘ 1` (macOS System Shortcuts), `Alt+1` (XWin), `Alt+1` (GNOME), `Alt+1` (KDE), `Alt+1` (Emacs), `Alt+1` (Sublime Text), `⌘ 1` (Sublime Text (macOS)), `Ctrl+Shift+E` (VSCode), `⌘ ⇧ E` (VSCode (macOS))) . In this case, you will use a context menu of a dump file to create a run configuration and select your target schema. You can run the dump files that are located in the directories attached to your project. This case might be preferable if the directory with your dump files is already attached to your GoLand project, and the files are available in the Project tool window .

For more information about ways of running SQL files in GoLand, refer to  the [Run an SQL file](run-sql-files.html#run_sql_file) topic.

## Step 1. Prepare files in IDE

Run files in Database:

For the   Database   tool window  scenario, you can skip this step.

Run files in Project tool window:

To use the files that are stored locally on your machine in the  Project tool window , you have to attach directories with them to your GoLand project.

Procedure: Attach the directory with dump files

1. You can open the  Project tool window  by doing one of the following:

* In the main menu, go to `View | Tool Windows | Files`.

* Press `Alt+1` (Windows), `⌘ 1` (macOS), `⌘ 1` (IntelliJ IDEA Classic (macOS)), `⌘ 1` (macOS System Shortcuts), `Alt+1` (XWin), `Alt+1` (GNOME), `Alt+1` (KDE), `Alt+1` (Emacs), `Alt+1` (Sublime Text), `⌘ 1` (Sublime Text (macOS)), `Ctrl+Shift+E` (VSCode), `⌘ ⇧ E` (VSCode (macOS)).

2. In the  Project tool window , click the Attach Directory to Project… button (![Attach Directory to Project](https://resources.jetbrains.com/help/img/idea/2026.3/app.expui.general.open.svg)) in the toolbar.

Alternatively, right-click in the area of the Files tool window and select Attach Directory to Project….

3. In the file browser, navigate to the directory that you want to attach .  In our case, it is the `dumps` directory.

4. Click Open.

![Directory with dump files is attached to the GoLand project](https://resources.jetbrains.com/help/img/idea/2026.3/db_tutorial_run_dumps_attach_directory.png)

## Step 2. Import structure dump

To run the dump files that contain structure-generating scripts, you will have to define the schema that you want to run the files and their scripts against. You can do this in a dedicated dialog.

Let's run the `sqlite-sakila-schema.sql` structure dump file that generates objects in the `main` schema.

Run files in Database:

Procedure:

1. In the   Database   tool window ,  right-click a data source, or a schema and select `SQL Scripts | Run SQL Script…`.

2. In the file browser window that opens, navigate to the  `sqlite-sakila-schema.sql` file.

3. Click Open.

You can view the output in the Run tool window.   For more information about tool window controls, refer to  [Run tool window](run-tool-window.html).

[Video](https://resources.jetbrains.com/help/img/idea/2026.3/db_tutorial_run_dumps_db_structure.mp4)

Run files in Project tool window:

Procedure:

1. In the  Project tool window ,  navigate to the sqlite-sakila-db tree node.

2. Expand sqlite-sakila-db tree node.

3. Right-click the `sqlite-sakila-schema.sql` file and select Run 'sqlite-sakila-schema...'. Alternatively, press `Ctrl+Shift+F10` (Windows), `⌃ ⇧ R` (macOS), `⌃ ⇧ F10` (IntelliJ IDEA Classic (macOS)), `⌃ ⇧ R` (macOS System Shortcuts), `Ctrl+Shift+F10` (XWin), `Ctrl+Shift+F10` (GNOME), `Ctrl+Shift+F10` (KDE), `Ctrl+Shift+F10` (Emacs), `Ctrl+Shift+F10` (Sublime Text), `Ctrl+Shift+F10` (Sublime Text (macOS)), `Ctrl+Shift+F10` (VSCode), `Ctrl+Shift+F10` (VSCode (macOS)).

4. In the Target data source / schema table of Edit Configuration dialog that opens, click the Add button (![The Add button](https://resources.jetbrains.com/help/img/idea/2026.3/app.expui.general.add.svg)) and select `SQLite | main`.

5. Click Run.

You can view the output in the Run tool window.   For more information about tool window controls, refer to  [Run tool window](run-tool-window.html).

[Video](https://resources.jetbrains.com/help/img/idea/2026.3/db_tutorial_run_dumps_files_structure.mp4)

Once the execution of the dump file with structure-generating scripts is done, your SQLite database has database objects in its `main` schema. You can work with the structure, explore it in the  Database  , and run queries in the query console.

## Step 3. Import data dump

To add data to those database objects, run the `sqlite-sakila-insert-data.sql` file with corresponding scripts against your `main` schema.

Run files in Database:

Procedure:

1. In the   Database   tool window ,  right-click a data source, or a schema and select `SQL Scripts | Run SQL Script…`.

2. In the file browser window that opens, navigate to the  `sqlite-sakila-insert-data.sql` file.

3. Click Open.

You can view the output in the Run tool window.   For more information about tool window controls, refer to  [Run tool window](run-tool-window.html).

[Video](https://resources.jetbrains.com/help/img/idea/2026.3/db_tutorial_run_dumps_db_data.mp4)

Run files in Project tool window:

Procedure:

1. In the  Project tool window ,  navigate to the sqlite-sakila-db tree node.

2. Expand sqlite-sakila-db tree node.

3. Right-click the `sqlite-sakila-insert-data.sql` file and select Run 'sqlite-sakila-insert...'. Alternatively, press `Ctrl+Shift+F10` (Windows), `⌃ ⇧ R` (macOS), `⌃ ⇧ F10` (IntelliJ IDEA Classic (macOS)), `⌃ ⇧ R` (macOS System Shortcuts), `Ctrl+Shift+F10` (XWin), `Ctrl+Shift+F10` (GNOME), `Ctrl+Shift+F10` (KDE), `Ctrl+Shift+F10` (Emacs), `Ctrl+Shift+F10` (Sublime Text), `Ctrl+Shift+F10` (Sublime Text (macOS)), `Ctrl+Shift+F10` (VSCode), `Ctrl+Shift+F10` (VSCode (macOS)).

4. In the Target data source / schema table of Edit Configuration dialog that opens, click the Add button (![The Add button](https://resources.jetbrains.com/help/img/idea/2026.3/app.expui.general.add.svg)) and select `SQLite | main`.

5. Click Run.

You can view the output in the Run tool window.   For more information about tool window controls, refer to  [Run tool window](run-tool-window.html).

[Video](https://resources.jetbrains.com/help/img/idea/2026.3/db_tutorial_run_dumps_files_data.mp4)

After running all the dump files, you can proceed with working with your database.

* For more information about working with database objects in GoLand, refer to [Database objects](database-objects.html).

* To write and run queries, open the default [query console](query-consoles.html) by clicking the data source and pressing `F4` (Windows), `⌘ ↓` (macOS), `F4` (IntelliJ IDEA Classic (macOS)), `F4` (macOS System Shortcuts), `F4` (XWin), `F4` (GNOME), `F4` (KDE), `F4` (Emacs), `F4` (Sublime Text), `F4` (Sublime Text (macOS)), `F4` (VSCode), `F4` (VSCode (macOS)).

* To view and edit data of a database object, open [Data editor and viewer](data-editor-and-viewer.html) by double-clicking the object.

