DataGrip 2023.2 Help

Glossary

Connection to a database

To connect to a database, DataGrip requires connection details (for example, host, port, password, SSH configuration settings, and so on). For every database, the connection details are stored in a dedicated connection configuration — data source.

For a data source, connections to the database are established in special wrappers — sessions. Each session is a wrapper over a single connection, and it stores the connection's information (for example, whether it is active or not, transaction control mode, and other settings).

A connection within a session appears when you perform an action that requires interaction with the database.

For example, once you double-click a table under a data source in Database Explorer, a new session is created, connected, and it has the data editor as its client. DataGrip requires an active connection to request the table data from the database, receive it, and display it in the data editor.

For more information about connecting to databases, refer to the Connection to a database topic.

Data source

Data source is a connection configuration. It stores a list of connection details that are used to establish connection to a database. For example, host, port, database name, driver, SSH and SSL configuration settings, and so on. In data source settings, you can also select databases and schemas for introspection and display in Database Explorer, and change the driver for your connection.

Data source with connection details for a PostgreSQL database

You can see the list of created data sources in the Database Explorer ( View | Tool Windows | Database Explorer) . Data sources with an active connection to a database are marked with a green dot in the corner of their icons.

Data sources in the Database Explorer

For more information about creating a data source for the supported database vendors, refer to the Create a data source section.

For more information about managing data sources, refer to the Data sources topic.

For more information about the Data Sources and Drivers dialog, refer to the Data Sources and Drivers dialog topic.

DDL data source

DDL data source is a virtual view of a database structure based on SQL files that contain data definition language statements (DDL statements). You can reference all tables, columns and other objects defined in such files in the editor. Diagrams are also supported.

DDL data source lets you maintain database versioning. Keep the SQL files under a VCS system and regenerate them every time your database structure is updated.

Once created, DDL data sources are available in Database Explorer ( View | Tool Windows | Database Explorer) . You can create and manage the SQL files with statements in the Files tool window ( View | Tool Windows | Files) .

DDL data source in Database Explorer and SQL files with statements in Files tool window

For more information about DDL data sources, refer to the DDL data sources topic.

Session

Each session is a wrapper over a single connection, and it stores the connection's information (for example, whether it is active or not, transaction control mode, and other settings).

Sessions can have clients — files, whose queries are sent via the connection that the session holds. Data editor can also be a client for a session.

For example, once you double-click a table in Database Explorer, a new session connects to the database, and the table is attached to the session as its client.

You can view data sources, sessions, and session clients in the Services tool window. Green dot in the corner of session's icon indicates a connected session.

For more information about sessions, refer to Sessions.

Data editor and viewer

The data editor and viewer, or data editor, provides a user interface for working with data. In the data editor, you can sort, filter, add, edit, and remove the data as well as perform other associated tasks.

In DataGrip, the data editor and viewer lets you work with database object data, query results sets, and also DSV files data.

Data editor tab
Data editor in a Result tab
Data editor in the in-editor results
Data editor tab in a delimiter-separated values file editor

For more information about data editor, refer to Data editor and viewer.

Database Explorer

In the Database Explorer ( View | Tool Windows | Database Explorer) , you can work with databases and DDL data sources. You can view and modify data structures in your databases, and perform other associated tasks.

The available data sources are shown as a tree of data sources, schemas, tables and columns.

the Database Explorer

For more information about working with database objects in Database Explorer, refer to the Database objects section.

For more information about Database Explorer, refer to the Database Explorer topic.

Introspection

Introspection is the process of loading the metadata of the database objects (for example, object names and types of columns) and source code. DataGrip uses this information to show the objects in Database Explorer, display their DDL, suggest them during completion, and for other coding assistance features.

By default, only the schemas and databases selected to be shown in the Database Explorer are introspected. Depending on the database size, the metadata that was loaded during its introspection can take a significant amount of time and disk space.

Once the necessary databases and schemas are introspected, IDE can resolve the database objects in your scripts to the correct context, depending on the attached session and resolve mode.

Oracle users might experience a long introspection time if all the objects are being processed, whereas it is usually not required for daily work and coding assistance. To reduce the amount of introspected objects, DataGrip has three introspection levels available for Oracle databases. For more information about them, refer to Oracle introspection levels.

For more information about troubleshooting an incorrect introspection, refer to the Reporting introspection issues topic.

Query console

Query or database consoles are SQL files that are attached to a data source. You can write and execute SQL statements in query consoles the same way as you do it in terminal.

When you create a data source, the data source's default query console is created automatically. If necessary, you can create additional query consoles.

Query console

For more information about query consoles, refer to the Query consoles topic.

For more information about other types of SQL files in DataGrip, refer to the File management topic.

User files in the attached directories

User files are the files that are stored on your machine or any other place you have access to. To work with them in DataGrip, attach the directory that contains them in the Files tool window .

Attach a directory with SQL files

For more information about user files, refer to the User files topic.

For more information about other types of SQL files in DataGrip, refer to the File management topic.

Last modified: 26 October 2023