DataGrip 2022.3 Help

Differences between query consoles, scratch files, and user files

To run your statements and keep track of your code ideas, use DataGrip's special file types. You can also work with the files that you store on your machine.

The DataGrip's special file types are consoles and scratches. Query or database consoles are SQL files in which you can compose and execute SQL statements. SQL scratch files let you create temporary notes or draft up some code outside the project context.

In DataGrip, the files that you store on your machine are user files. To work with them, attach the directory with the files you need to your DataGrip project.

Context

Functionality

Consoles

Executable SQL files that are attached to a specific data source.

  • Files that you can use to compose and execute SQL statements in the project context.

  • Console files are attached to a data source.

  • Default resolve mode is Playground.

Scratches

Files that are not attached to a specific data source.

  • Temporary notes or drafts for your code outside the project context.

  • By default, scratch files are not attached to a data source.

  • Default resolve mode is Script.

User files

Files that are stored on your machine.

  • Can be attached to different projects.

  • Can be put under Version Control.

  • By default, user files are not attached to a data source.

  • Default resolve mode is Script.

Find the attached directories at the top of the Files tool window. For query consoles, in the Files tool window, navigate to Scratches and Consoles | Database Consoles. Find scratch files under Scratches and Consoles | Scratches.

Consider the following figure that shows locations of the elements.

Differences between query consoles and scratch files
  1. Console file tab.

  2. Scratch file tab.

  3. Resolve mode.

  4. Schema selected in the <schema> list.

  5. Attached session selected in the <session> list.

  6. Attached directories.

  7. Console files.

  8. Scratch files.

Last modified: 05 December 2022