WebStorm 2022.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 Project tool window.

Running SQL files

Run an SQL file

  • Using a Database tool window context menu action:

    1. 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 SQL file that you want to apply.

    Run an SQL file
  • Dragging an SQL script file:

    1. Open the Project tool window, navigate to the SQL file, and select it.

    2. Drag the SQL file to the data source or schema in Database tool window that you want to run it against.

Run an SQL file for several data sources

  1. In the Project tool window (View | Tool Windows | Project), select file or files that you want to run.

  2. Right-click the selection and navigate to Run <configuration_name> (or press Ctrl+Shift+F10). This action creates a temporary run configuration.

  3. In the Edit Configuration window that opens, click the Add button (the Add button) in the Target data source / schema pane and select data sources or schemes against which you want to run selected files.

    You can click the Recent button (the History button) to select data sources that you used recently.

    Run an SQL file for several data sources
  4. Click Run.

Run individual statements

  1. Open an SQL file in WebStorm.

  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 query 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.

WebStorm 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. Open settings by pressing Ctrl+Alt+S and navigate to Languages & Frameworks | SQL Dialects.

  2. Click the Add button the Add button and select directories or files for which you want to change a dialect.

  3. Click Open.

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

  5. Apply changes and click OK.

    Specify an SQL dialect
Last modified: 05 December 2022