PyCharm 2.7.2 Web Help

PyCharm does not enable you to create databases, but provides facilities to manage and query them. Once you are granted access to a certain database, you can configure one or more data sources within PyCharm that reflect the structure of the database and store the database access credentials. Based on this information, PyCharm establishes connection to the database and provides the ability to retrieve or change information contained therein.

In this section:

Global and Local Data Sources

PyCharm distinguishes between Global and Local data sources.

  • Global data sources are available in all projects in your workspace.
  • Local data sources are available in one specific project only.

Types of Data Sources

PyCharm supports data sources of the following types:

  • DB data sources, which correspond to the existing databases the application you are developing will interact with.
  • DDL data sources, which represent the necessary data structures and act as stub databases, the databases without any data. For this data source type you should have one or more DDL files (SQL file type) representing the required data structures available in your project directory (or one of its subdirectories). Also note that a particular SQL dialect should be set for all those files (or the directories containing those files).

DB data sources can be both global and local; DDL data sources can be configured only at the project level.

Connection

PyCharm establishes a database connection between a data source and the corresponding database automatically, the first time it needs to execute a query. A database connection is displayed in the Database tool window as a node below the data source via which it is established, and is marked with the database_connection.png icon.

PyCharm closes a connection automatically upon the session termination; alternatively, you can close a database connection manually (stop Close Connection in the context menu of a connection (DeleteDelete)).

Access to Data Sources

Access to data sources is supported through a variety of PyCharm features and components:

See Also

Reference:

Web Resources: