RubyMine 2023.1 Help

Run files

SQL files are run against the selected databases or schemas using run configurations. Depending on your purposes, you can run SQL files by either creating new run configurations or editing the existing ones.

For more information about run configurations, see Run/debug configurations.

Run the current SQL file

On top of running applications from the editor, you can run single files using a dedicated option on the toolbar. The run and debug buttons are active and allow you to instantly run the currently opened file.

  1. In the editor, open the file that you want to run.

  2. Click Run next to the Current File option on the toolbar.

  3. In the Target data source / schema pane of Edit Configuration dialog, click the Add button (the Add button) and select the databases or schemas against which you want to run your database scripts. This setting is dialect-dependent.

    If you select a data source as a target, RubyMine displays a schema in which the script will be run. It is the default schema.

    Edit Configuration dialog
  4. Click Run.

You can access other runners from the submenu as well: expand the list and click the right arrow next to Current File. From the menu that opens, you can debug the code, run it with coverage, or open the run configuration to specify more options.

Run SQL files

  1. Open the Run/Debug Configuration dialog in one of the following ways:

    • Select Run | Edit Configurations from the main menu.

    • With the Navigation bar visible (View | Appearance | Navigation Bar), choose Edit Configurations from the run/debug configuration selector.

      Edit run configurations
    • Press Alt+Shift+F10 and then press 0.

  2. In the Run/Debug Configuration dialog, click the Add New Configuration icon (the Add New Configuration icon) and select Database Script.

    The fields that appear in the right-hand pane display the default settings for the selected configuration type.

    • Target data source / schema: databases or schemas against which you want to run your database scripts. This setting is dialect-dependent.

      If you select a data source as a target, RubyMine displays a schema in which the script will be run. It is the default schema.

    • Script files: SQL files that you want to run. To add files, click the Add button (the Add button) and navigate to files that you want to run. If a script contains schema switching, you will see a warning (Warning).

  3. Click OK to apply the changes and close the dialog.

  4. To run the configuration, click the Run <configuration_name> button (The Run button).

Run an SQL file for several data sources

  1. In the Project tool window (Alt+1), select file or files that you want to run.

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

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

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

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

View output

When you run a file or use a run configuration, the output is shown in the tab of a Run tool window. For more information about the tool window controls, refer to Run tool window.

File run output

Tips and tricks

Execute a file from the search dialog

  1. Press Shift twice.

  2. In the Search Everywhere dialog, type the filename.

  3. Select a file by using Up and Down arrows.

  4. Press Ctrl+Shift+F10.

  5. In the Edit Configuration window, click the Add button (the Add button) and select data sources or schemes against which you want to run selected files.

    Execute a file from the search dialog
Last modified: 28 April 2023