DataGrip 2019.3 Help

User files

To work with files from your machine or any other place you have access to, attach the directory you need to the Files tool window.

Managing directories

Attach a directory with SQL files

  1. Click View | Tool Windows | Files.

  2. In the Files tool window, right-click any area and select Attach directory.

  3. Navigate to the directory that you want to attach.

  4. Click OK.

Detach a directory with SQL files

  1. In the Files tool window (View | Tool Windows | Files), right-click a directory and select Detach Directory.

  2. In the notification dialog, click Detach.

Detach a directory with SQL files

Running SQL files

Run an SQL file

  1. Right-click a data source.

  2. Select Run SQL Script.

  3. In the Select Path window, navigate to the SQL file that you want to apply.

    Run an SQL file

Run an SQL file for several data sources

  1. Select the necessary SQL file in the Files tool window.

  2. Right-click the SQL file, select Run <file_name> (or press Ctrl+Shift+F10).

  3. In the Execution target window, select the necessary data sources.

    Run an SQL file for several data sources

Run individual statements

  1. Open an SQL file in DataGrip.

  2. Click the statement that you want to execute. If you want to execute more than one statement, select (highlight) the necessary statements.

  3. Press Ctrl+Enter or select Execute from the context menu.

  4. Select the database console where you want to execute the statement.

    Run individual statements

Configuring a dialect for SQL files

For better coding assistance, assign an SQL dialect to an SQL file. An SQL dialect is a DBMS-specific version of SQL.

DataGrip lets you specify the SQL dialect for an individual file or all SQL and DDL files that can be stored in a directory, in your project, or on your computer.

Specify a dialect for a single SQL file

  1. Click the dialect list, which is in the upper-right corner of the window.

  2. Select a dialect from the dialect list.

    Specify an SQL dialect

Specify a dialect for multiple SQL files

  1. Click the dialect list, which is in the upper-right corner of the window.

  2. Select SQL Dialects.

  3. In the SQL Dialects dialog, click the Add button the Add button and select directories or files for which you want to change a dialect.

  4. Click Open.

  5. Click the SQL Dialect cell and select the necessary dialect.

  6. Apply changes and click OK.

    Specify an SQL dialect
Last modified: 13 April 2020