Managing data sources
Data source is a location of data for your application.
In CLion, you can define the following data sources:
Database data source: operational databases that contain data (see Connecting to a database).
Data Definition Language (DDL) files: SQL files that contain data definition language statements (see Add a DDL data source).
Create a data source
Create a DB data source from database files
If database files are in your project folder, open the Project tool window. Otherwise, open your file manager.
Open the Database tool window ( ).
Select the files that you want to use as data sources and drag them to the Database tool window. A separate data source is created for each file.
If you do not have the necessary database driver files, download them. Click
on the toolbar of the Database tool window. Alternatively, select Properties from the context menu.
In the Data Sources and Drivers window, click the Download link.
To ensure that the connection to the data source is successful, click Test Connection, and click OK.
Configure data sources from project files
You can use files that contain database connection settings to create DB data sources.
Open the Database tool window ( ).
-
Click
on the toolbar and select Import from sources. Alternatively, right-click the area under the toolbar or under existing data sources, select New, and click Import from sources.
In the Data Sources and Drivers window, you can see names of candidate data sources in the green color.
-
Download the driver files if they are missing.
To specify a driver, perform one of the following steps:
To download the necessary driver, click the Download link.
- To specify the driver files that you already have available on your computer, click the <DriverName> link to the right of Driver.
On the page where the driver settings are shown, under JDBC drivers / Additional, click
and select necessary files.
Return to the page with the data source settings.
To ensure that the connection to the data source is successful, click Test Connection.
Click OK.
Create a DDL data source
Open the Database tool window ( ).
Click the Data Source Properties icon (
) on the toolbar, and select DDL Data Source.
Specify the data source name.
In the DDL Files form, click the Add icon (
) and select necessary SQL files.
Customizing data sources
Configure data source settings
In the Database tool window ( ), select a data source that you want to change.
Click the Data Source Properties icon (
) on the toolbar (or press Shift+Enter).
In the Data Sources and Drivers window, edit the data source properties. For more information about data source properties, see Data source settings and DDL data source settings.
Group data sources
If you have a number of different databases, you can group their data sources in the Database tool window ( ). To group data sources, select the necessary data source, press F6, or select Move to Group from the context menu.
The following options are available for data source groups in the Move to Group menu:
Create a new group for the data source.
Move the data source to the root list. This option removes the data source from a group.
Move the data source to an existing group.

Remove data sources
To remove a data source, in the Database tool window ( ), press Delete. Alternatively, you can select Remove from the context menu, or click .
Also, to remove a data source, you can use the Data Sources and Drivers window ( ). In the Data Sources and Drivers window, select the data source and press Delete. Alternatively, you can click on the toolbar, or select Remove from the context menu.