This feature is only supported in the Professional edition. This edition is commercial, and it provides an outstanding set of features: see the comparison matrix for more details.
Currently, PyCharm supports the following vendors. The support includes such features as enhanced code completion and better retrieval of database objects (introspection). If your vendor is not in the list, you still can connect to the database with a JDBC driver. For more information, see Create a connection to a database with a JDBC driver.
To install Visual Studio for Mac, you can download it here. If you want to see this application continue to grow as a viable option to use Microsoft development tools outside of their platform, please consider stopping by their website and request the features you like most from the Windows Visual Studio IDE. Visual Studio will allow Mac-centric developers to build, deploy and debug in Azure, which Microsoft hopes will encourage more cross-platform development. This all leads back to Microsoft. Mac-based devs still can’t natively code in Swift or Objective-C via Visual Studio, nor can they access Apple’s.
To issue a query to a database, you must connect to a data source. The data source is a location of your data (it can be a server, CSV, or a DDL file). The data source connection includes a name and connection settings that are dependent on the data source type.
Amazon Redshift
- In your Redshift dashboard, create a Redshift cluster.
- In settings of the Redshift cluster, copy the JDBC URL.
- In the Database tool window (View | Tool Windows | Database), click the Data Source Properties icon .
- In the Data Sources and Drivers dialog, click the Add icon () and select Amazon Redshift.
- At the bottom of the data source settings area, click the Download missing driver files link. Alternatively, you can specify user drivers for the data source. For more information about user drivers, see Add a user driver to an existing connection.
- From the Connection type list, select URL only.
- Paste the JDBC URL from the Redshift cluster settings to the URL field in PyCharm.
- In User and Password fields, specify your Redshift credentials.
- To ensure that the connection to the data source is successful, click Test Connection.
Apache Derby
- In the Database tool window (View | Tool Windows | Database), click the Data Source Properties icon .
- In the Data Sources and Drivers dialog, click the Add icon () and select Apache Derby.
- From the Driver list, select the type of the JDBC driver that you want to use. For remote connections, select Apache Derby (Remote). For embedded databases, select Apache Derby (Embedded).
- At the bottom of the data source settings area, click the Download missing driver files link. Alternatively, you can specify user drivers for the data source. For more information about user drivers, see Add a user driver to an existing connection.
- Specify database connection details. Alternatively, paste the JDBC URL in the URL field.To set an empty password, right-click the Password field and select Set empty.
- To ensure that the connection to the data source is successful, click Test Connection.
Apache Cassandra
- In the Database tool window (View | Tool Windows | Database), click the Data Source Properties icon .
- In the Data Sources and Drivers dialog, click the Add icon () and select Apache Cassandra.
- At the bottom of the data source settings area, click the Download missing driver files link. Alternatively, you can specify user drivers for the data source. For more information about user drivers, see Add a user driver to an existing connection.
- Specify database connection details. Alternatively, paste the JDBC URL in the URL field.To set an empty password, right-click the Password field and select Set empty.
- To ensure that the connection to the data source is successful, click Test Connection.
If you want to configure an SSL connection to Apache Cassandra, see https://www.jetbrains.com/help/datagrip/how-to-connect-to-cassandra-with-ssl.html in the DataGrip documentation.
Apache Hive
- In the Database tool window (View | Tool Windows | Database), click the Data Source Properties icon .
- In the Data Sources and Drivers dialog, click the Add icon () and select Apache Hive.
- At the bottom of the data source settings area, click the Download missing driver files link. Alternatively, you can specify user drivers for the data source. For more information about user drivers, see Add a user driver to an existing connection.
- Specify database connection details. Alternatively, paste the JDBC URL in the URL field.To set an empty password, right-click the Password field and select Set empty.
- To ensure that the connection to the data source is successful, click Test Connection.
Azure SQL Database
- In your Microsoft Azure account, create an SQL data source.
- In PyCharm, navigate to File | Data SourcesCtrl+Shift+Alt+S.
- In the Data Sources and Drivers dialog, click the Add icon () and select Azure SQL Database.
- At the bottom of the data source settings area, click the Download missing driver files link.
- Specify database connection details. Alternatively, paste the JDBC URL in the URL field.To set an empty password, right-click the Password field and select Set empty.To use Azure Active Directory Authentication, select Use Windows domain authentication. To use SQL Authentication, clear the checkbox, and specify your Microsoft Azure credentials in User and Password fields.
- To ensure that the connection to the data source is successful, click Test Connection.
The Use Windows domain authentication checkbox is available only on Windows operating systems.
Microsoft Azure supports PostgreSQL, MySQL, MariaDB, and other Database Management Systems (DBMS). If you want to connect to these data sources, create data source connections that correspond to these DMBS. In PyCharm, these connections already include necessary JDBC drivers. So, if you want to connect to the Azure database for PostgreSQL, create the PostgreSQL connection.
ClickHouse
- In the Database tool window (View | Tool Windows | Database), click the Data Source Properties icon .
- In the Data Sources and Drivers dialog, click the Add icon () and select ClickHouse.
- At the bottom of the data source settings area, click the Download missing driver files link. Alternatively, you can specify user drivers for the data source. For more information about user drivers, see Add a user driver to an existing connection.
- Specify database connection details. Alternatively, paste the JDBC URL in the URL field.To set an empty password, right-click the Password field and select Set empty.
- To ensure that the connection to the data source is successful, click Test Connection.
DDL data source
SQL files that contain data definition language statements (DDL statements) can be used as data sources. As a result, you can reference all tables, columns and other objects defined in such files in the editor.
- In the Database tool window (View | Tool Windows | Database), click the Data Source Properties icon .
- In the Data Sources and Drivers dialog, click the Add icon () and select DDL Data Source.
- In the DDL Files pane, click the Add button .
- In the file browser, navigate to the SQL file or files with DDL statements and click Open.
- Click Apply.
- In the SQL Dialects dialog, select a dialect that you want to use for the added SQL file.
- Apply settings and click OK.
You can attach a directory with SQL files that contain DDL statements and drag them from the Files tool window to the Database tool window.
Exasol
- In the Database tool window (View | Tool Windows | Database), click the Data Source Properties icon .
- In the Data Sources and Drivers dialog, click the Add icon () and select Exasol.
- At the bottom of the data source settings area, click the Download missing driver files link. Alternatively, you can specify user drivers for the data source. For more information about user drivers, see Add a user driver to an existing connection.
- Specify database connection details. Alternatively, paste the JDBC URL in the URL field.To set an empty password, right-click the Password field and select Set empty.
- To ensure that the connection to the data source is successful, click Test Connection.
Greenplum
- In the Database tool window (View | Tool Windows | Database), click the Data Source Properties icon .
- In the Data Sources and Drivers dialog, click the Add icon () and select Greenplum.
- At the bottom of the data source settings area, click the Download missing driver files link. Alternatively, you can specify user drivers for the data source. For more information about user drivers, see Add a user driver to an existing connection.
- Specify database connection details. Alternatively, paste the JDBC URL in the URL field.To set an empty password, right-click the Password field and select Set empty.
- To ensure that the connection to the data source is successful, click Test Connection.
H2
- In the Database tool window (View | Tool Windows | Database), click the Data Source Properties icon .
- In the Data Sources and Drivers dialog, click the Add icon () and select H2.
- At the bottom of the data source settings area, click the Download missing driver files link. Alternatively, you can specify user drivers for the data source. For more information about user drivers, see Add a user driver to an existing connection.
- Specify database connection details. Alternatively, paste the JDBC URL in the URL field.To set an empty password, right-click the Password field and select Set empty.
- To ensure that the connection to the data source is successful, click Test Connection.
You can select between different H2 connection modes: Remote, In-memory, Embedded. For more information about these modes, see the official H2 documentation.
HSQLDB
- In the Database tool window (View | Tool Windows | Database), click the Data Source Properties icon .
- In the Data Sources and Drivers dialog, click the Add icon () and select HSQLDB.
- At the bottom of the data source settings area, click the Download missing driver files link. Alternatively, you can specify user drivers for the data source. For more information about user drivers, see Add a user driver to an existing connection.
- Specify database connection details. Alternatively, paste the JDBC URL in the URL field.To set an empty password, right-click the Password field and select Set empty.
- To ensure that the connection to the data source is successful, click Test Connection.
IBM Db2
- In the Database tool window (View | Tool Windows | Database), click the Data Source Properties icon .
- In the Data Sources and Drivers dialog, click the Add icon () and select IBM Db2.
- At the bottom of the data source settings area, click the Download missing driver files link. Alternatively, you can specify user drivers for the data source. For more information about user drivers, see Add a user driver to an existing connection.
- Specify database connection details. Alternatively, paste the JDBC URL in the URL field.To set an empty password, right-click the Password field and select Set empty.
- To ensure that the connection to the data source is successful, click Test Connection.
MariaDB
- In the Database tool window (View | Tool Windows | Database), click the Data Source Properties icon .
- In the Data Sources and Drivers dialog, click the Add icon () and select MariaDB.
- At the bottom of the data source settings area, click the Download missing driver files link. Alternatively, you can specify user drivers for the data source. For more information about user drivers, see Add a user driver to an existing connection.
- Specify database connection details. Alternatively, paste the JDBC URL in the URL field.To set an empty password, right-click the Password field and select Set empty.
- To ensure that the connection to the data source is successful, click Test Connection.
Microsoft SQL Server
- In the Database tool window (View | Tool Windows | Database), click the Data Source Properties icon .
- In the Data Sources and Drivers dialog, click the Add icon () and select Microsoft SQL Server.
- At the bottom of the data source settings area, click the Download missing driver files link. Alternatively, you can specify user drivers for the data source. For more information about user drivers, see Add a user driver to an existing connection.
- Specify database connection details. Alternatively, paste the JDBC URL in the URL field.To set an empty password, right-click the Password field and select Set empty.The Instance field is optional.
- To ensure that the connection to the data source is successful, click Test Connection.
If your TCP/IP connection to the host has failed, consider enabling TCP/IP in the SQL Server Network Configuration. For more information about configuring Microsoft SQL Server, Windows domain authentication, and user permissions, see How to connect to MS SQL server in the DataGrip documentation.
For more information about cSettings_File_Encodingsonnecting to LocalDB, see How to connect to SQL Server Express LocalDB in the DataGrip documentation.
MySQL
- In the Database tool window (View | Tool Windows | Database), click the Data Source Properties icon .
- In the Data Sources and Drivers dialog, click the Add icon () and select MySQL.
- At the bottom of the data source settings area, click the Download missing driver files link. Alternatively, you can specify user drivers for the data source. For more information about user drivers, see Add a user driver to an existing connection.
- Specify database connection details. Alternatively, paste the JDBC URL in the URL field.To set an empty password, right-click the Password field and select Set empty.
- To ensure that the connection to the data source is successful, click Test Connection.
Oracle
- In the Database tool window (View | Tool Windows | Database), click the Data Source Properties icon .
- In the Data Sources and Drivers dialog, click the Add icon () and select Oracle.
- At the bottom of the data source settings area, click the Download missing driver files link.
- From the Connection Type list, select a connection type:
- SID: to use a unique name of an Oracle instance (a process that runs on the workstation).
- Service name: to use an alias to an Oracle instance (or many instances).
- TNS: to use tnsnames.ora configuration file. In TNSADMIN field, specify a path to the tnsnames.ora file. In TNS name, specify what service name to use (see a value of
net_service_name
in tnsnames.ora) if you have more than one service. - URL only: to use the JDBC URL.
- Specify database connection details. Alternatively, paste the JDBC URL in the URL field.To set an empty password, right-click the Password field and select Set empty.
- From the Driver list, specify the driver type. For more information about driver types, see Oracle JDBC FAQ.
- At the bottom of the data source settings area, click the Download missing driver files link. Alternatively, you can specify user drivers for the data source. For more information about user drivers, see Add a user driver to an existing connection.
- To ensure that the connection to the data source is successful, click Test Connection.
PostgreSQL
- In the Database tool window (View | Tool Windows | Database), click the Data Source Properties icon .
- In the Data Sources and Drivers dialog, click the Add icon () and select PostgreSQL.
- At the bottom of the data source settings area, click the Download missing driver files link. Alternatively, you can specify user drivers for the data source. For more information about user drivers, see Add a user driver to an existing connection.
- Specify database connection details. Alternatively, paste the JDBC URL in the URL field.To set an empty password, right-click the Password field and select Set empty.
- To ensure that the connection to the data source is successful, click Test Connection.
Snowflake
- In the Database tool window (View | Tool Windows | Database), click the Data Source Properties icon .
- In the Data Sources and Drivers dialog, click the Add icon () and select Snowflake.
- At the bottom of the data source settings area, click the Download missing driver files link. Alternatively, you can specify user drivers for the data source. For more information about user drivers, see Add a user driver to an existing connection.
- Specify database connection details. Alternatively, paste the JDBC URL in the URL field.To set an empty password, right-click the Password field and select Set empty.
- To ensure that the connection to the data source is successful, click Test Connection.
Warehouse is a cluster of compute resources in Snowflake. A warehouse provides the required resources, such as CPU, memory, and temporary storage. For more information about Snowflake, see the Snowflake user guide.
SQLite
- In the Database tool window (View | Tool Windows | Database), click the Data Source Properties icon .
- In the Data Sources and Drivers dialog, click the Add icon () and select SQLite.
- At the bottom of the data source settings area, click the Download missing driver files link. Alternatively, you can specify user drivers for the data source. For more information about user drivers, see Add a user driver to an existing connection.
- To connect to an existing SQLite database, specify a file path to the database file in the File field.
- To ensure that the connection to the data source is successful, click Test Connection.
Sybase ASE
- In the Database tool window (View | Tool Windows | Database), click the Data Source Properties icon .
- In the Data Sources and Drivers dialog, click the Add icon () and select Sybase ASE.
- At the bottom of the data source settings area, click the Download missing driver files link. Alternatively, you can specify user drivers for the data source. For more information about user drivers, see Add a user driver to an existing connection.
- Specify database connection details. Alternatively, paste the JDBC URL in the URL field.To set an empty password, right-click the Password field and select Set empty.
- To ensure that the connection to the data source is successful, click Test Connection.
Vertica
- In the Database tool window (View | Tool Windows | Database), click the Data Source Properties icon .
- In the Data Sources and Drivers dialog, click the Add icon () and select Vertica.
- At the bottom of the data source settings area, click the Download missing driver files link. Alternatively, you can specify user drivers for the data source. For more information about user drivers, see Add a user driver to an existing connection.
- Specify database connection details. Alternatively, paste the JDBC URL in the URL field.To set an empty password, right-click the Password field and select Set empty.
- To ensure that the connection to the data source is successful, click Test Connection.