File management
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, and edit the DDL of database objects in the DataGrip internal files.
Query or database consoles are SQL files that are attached to a particular data source. When you create a data source, a query 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 session mode. For more information about query consoles, refer to Query 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, refer to 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, refer to User files.
Object editors are internal files where you edit the DDL of a procedure, a view, a function, or other objects.
Context | Functionality | |
---|---|---|
Query consoles | Executable SQL files that are attached to a specific data source. |
|
Scratches | Files that are not attached to a specific data source. |
|
User files | Files that are stored on your machine. |
|
Locate SQL files
Find your SQL files in the Files tool window ( ) .
The attached directories are displayed at the top of the tool window.
For query consoles, navigate to
.Find scratch files under
.
Consider the following figure that shows locations of the elements.
Query console file tab.
Scratch file tab.
Schema selected in the <schema> list.
Project root folder.
The session selected in the <session> list, to which the current SQL file is attached.
Attached directories.
Console files.
Scratch files.