Context menu
| Item | Icon | Shortcut | Description | Available in |
|---|---|---|---|---|
| Add Data Source | ![]() | Alt+Insert | Choose this command to create a new data source.
Select the data source type or the import command:
| All contexts |
| Remove | ![]() | Delete | Choose this command to remove the selected data source entry from the list. | Data source node |
| Close Database Connection | ![]() | Delete | Choose this command to close the selected active database connection. Note that PyCharm opens connections when necessary without any steps from your side, and displays them beneath the corresponding data source nodes. | Active connection |
| Copy Data Source | ![]() | Ctrl+D | Choose this command to have a copy of the current data source created with the incremental name. | Data source node |
| Copy Reference | Ctrl+Alt+Shift+C | Choose this command to copy the fully qualified name of the selected item to the clipboard. | All contexts | |
| Data Source Properties | ![]() | Enter | Choose this command to view or edit the properties of the selected data source. Depending on the data source type, one of the following dialogs will open: | Data source node |
| Find Usages | Alt+F7 | Select the desired node (data source, schema, table, column) and press Alt+F7. The usages of tables and columns include database schema usages, i.e. references in indices, primary and foreign keys. | All contexts | |
| Compare | ![]() | Ctrl+D | Select two nodes, and choose this command on the context menu. The differences are shown in Differences Viewer for Folders and DB Objects. | All contexts |
| Refresh Tables | ![]() | Ctrl+Alt+Y | Choose this command to have the current data source updated and the database tables loaded. | All contexts |
| Open Database Console | ![]() | Ctrl+Shift+F10 | Choose this command to run the Database console. | All contexts |
| Open Table Editor | ![]() | F4 | Choose this command to open the selected database table in the Table Editor.
The Table Editor is available only for the DB type data sources. See also, Manipulating Table Data in the Table Editor. | DB table node |
| Generate and Copy DDL | Ctrl+C or Ctrl+Insert | Choose this command to have data structure definition statements generated based on the selected node.
The generated statements are stored in the clipboard. | All contexts | |
| Diagrams | Ctrl+Shift+Alt+U
Ctrl+Alt+U | Choose this command, and then select one of the possible ways to view database structure:
| All contexts | |
| View table data | Ctrl+Q | Choose the desired table and press Ctrl+Q
to view the create table query for the table and its first 10 rows.
This action has no command on the context menu. | All contexts, except for connection nodes. |
Tree view nodes
| Icon | Description |
|---|---|
| DB data source |
|
| DDL data source |
| Schema |
| Table |
| Column |
| Column with a primary key |
| Column with a foreign key |
| Column with an index |
| Primary key |
| Foreign key |
| Index |
|
Database connection node for a data source.
PyCharm establishes a database connection automatically first time it needs to execute a query,
and closes it automatically upon the session end. If necessary, a connection can be terminated manually,
using the context menu command |









