IntelliJ IDEA 2019.3 Help

File management

In IntelliJ IDEA, you can work with four file types:

  • Database or query console is an SQL file that is attached to a particular data source. When you create a data source, a database console is created automatically. But you can add more consoles to a data source, each of them will then create a new connection. If you do not want to create new connections, enable single connection mode. See more about consoles in Database consoles.

  • Scratch files are similar to query consoles, but they are not attached to a data source. We refer to scratch files as temporary notes or drafts for code ideas. Usually, scratch files are outside of the project context. But you can associate an SQL scratch file with a data source and use it as an SQL editor. For more information about scratch files, see Scratch files.

  • User files are SQL scripts that you store on your computer or on a server. For more information about working with directories and user files, see User files.

  • Object editors are internal files where you edit the DDL of a procedure, a view, a function, or other objects.

Create an SQL file

  1. In the Project tool window (View | Tool Windows | Project), right-click the directory in which you want to create an SQL file and select File.

  2. In the New File dialog, specify the filename with the SQL extension.

Productivity tips

Run consoles, scratches, and user files without opening them

  1. Select the necessary SQL file in the Project 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
Last modified: 26 April 2020