Database window
Ctrl+Alt+3
Overview
In the Database tool window ( ), you can work with databases and DDL data sources. You can view and modify data structures in your databases, and perform other associated tasks. To view a table, double-click the table. For more information about different viewing modes, see View data.
The available data sources are shown as a tree of data sources, schemas, tables and columns. If no data sources are currently defined, use the New command Alt+Insert to create a data source.
Most of the functions in this window are accessed by means of the toolbar icons or context menu commands. (If the toolbar is not currently shown, click on the title bar and select Show Toolbar.) Many of the commands have keyboard shortcuts. If the toolbar is hidden, the Refresh and Open Query Console commands can be access by means of the title bar icons ( and respectively).
Toolbar icons, context menu commands and shortcuts
Icon | Command | Shortcut | Description | Available for |
---|---|---|---|---|
Collapse all the nodes. | All node types | |||
New | Alt+Insert | Create a new data source, database, schema, query console, table, column, index, or a primary or foreign key. The list of options depends on which element is currently selected. | Data sources and their elements. If a DDL data source is selected, you can only choose to create another data source. | |
Duplicate | Ctrl+D | Create a copy of the selected data source. Specify the properties of the data source in the Data Sources and Drivers dialog that opens. | DB and DDL data source nodes | |
Refresh | Ctrl+F5 | data sources and their elements | ||
Data Source Properties | Open the Data Sources and Drivers dialog to manage your data sources and their settings. | All node types | ||
Disconnect | Ctrl+F2 | Close the database connection for the selected data source or data sources. (The names of the data sources with active database connections are shown in bold.) | Data sources with active connections and their elements | |
or | Open Editor | F4 or Ctrl+B | Open the data editor or the definition editor for the selected item. | Corresponding elements in data sources. |
Jump to Query Console | Ctrl+Shift+F10 | Open the default query console for the corresponding data source. | Data sources and their elements (tables and table columns) | |
Filter | Open a list of database objects that you can filter for the selected database. The list of database objects depends on the selected database. To see a full list of available database objects and their icons, go to Icons for data sources and their elements. | Data sources and their elements | ||
Rename | Shift+F6 | Rename the selected data source, table or column. Specify the new name in the dialog that opens. | All node types | |
Modify Table, Modify Column, Modify Index, Modify Key, Modify Foreign Key | Ctrl+F6 | Corresponding elements in data sources | ||
Copy Reference | Ctrl+Alt+Shift+C | Copy the fully qualified name of the selected data source, table or column to the clipboard. | All node types | |
Find Usages | Alt+F7 | Find the usages of (references to) the selected item (data source, table or column) in your source files and libraries. | All node types | |
Database Tools | Hide Schemas | Hide the selected schemas. See Show and hide schemas. | Schemas in data sources | ||
Database Tools | Manage Shown Schemas | Open the Schemas popup for the current data source. See Show and hide schemas. | Data sources and their elements | ||
Database Tools | Forget Cached Schema | Data sources | |||
Database Tools | Copy Settings | Copy the settings for the selected data source onto the clipboard. | Data sources | ||
Database Tools | Drop Primary Key | Remove the primary key constraint for the current table. | Tables and columns in data sources | ||
Database Tools | Drop Foreign Key | Remove the foreign key constraint. | Columns with the foreign key constraint in data sources | ||
Database Tools | Truncate | Remove all the rows in the selected table. | Tables in data sources | ||
Drop or Remove | Delete | Remove the selected item. | All node types | |
Open Query Console | Create and open a new query console for the corresponding data source. | Data sources and their elements | ||
Generate and Copy DDL | Ctrl+Shift+C | Generate DDL definitions for the selected data source, schema, table, view, stored procedure or function, and copy those definitions onto the clipboard. | All node types except columns | |
Generate DDL to Query Console | Open a DDL definition of the selected table or view in a query console. | Tables and views in data sources | ||
Compare | Ctrl+D | Select two data sources, schemas or tables and then use this command to compare table structures for the selected items. The comparison results are shown in the differences viewer. | DB and DDL data sources and tables | |
Export Data to File(s) | Data sources, and schemas, tables and views within them | |||
Export with "mysqldump" or Export with "pg_dump" | Run mysqldump or pg_dump for the selected items. | MySQL and PostgreSQL data sources, and schemas, tables and views within them | ||
Import Data from File | Schemas, tables and columns in data sources. For columns, the result will be the same as for schemas | |||
Restore with "mysql", Restore with "psql" or Restore | Run mysql , pg_restore or psql to restore a data dump. | MySQL data sources, databases and schemas. PostgreSQL data sources, databases, schemas and tables | ||
Color Settings | Set or change the color for the selected element or elements. (The Database Color Settings dialog will open.) | All node types | ||
Scripted Extensions / Generate POJOs.clj | Generate a Java entity class for the selected table. In the dialog that opens, specify the directory in which the | class file should be generated.Tables | ||
Scripted Extensions / Go to Scripts Directory | Switch to the directory where the | example script file is located.All node types | ||
View | Quick Documentation (in the main menu) | Ctrl+Q | All node types |
View options
The view options, generally, define what is shown in the tool window and how. To view or change these options, click on the title bar.
Option | Description | ||||
---|---|---|---|---|---|
Group Schema | This option defines how schema elements are shown. When on, there are separate nodes for tables, views and stored routines (shown as folders). Tables, views and routines (procedures and functions) are shown as elements of the corresponding groups. When off, there is no explicit grouping for tables, views, and routines. Tables and views are followed by procedures and functions. | ||||
Group Contents | This option defines how table elements are shown. When on, there are separate nodes for columns, indexes, primary and foreign key constraints, and triggers (shown as folders). The elements appear in the corresponding groups. When off, there is no such grouping and, generally, only columns are shown for tables. | ||||
Show Empty Groups | If the Group Schema or the Group Contents option is on, you can select to show or hide the categories that contain no elements. The Show Empty Groups option is on: The Show Empty Groups option is off: | ||||
Show Intermediate Nodes | Shows or hides parent nodes only when you do not have other objects on the same level with a parent.
| ||||
Sort Alphabetically | When this option is off, columns, generally, are unsorted. When this option is on, the columns are ordered alphabetically. | ||||
Show Toolbar | Select or deselect this option to show or hide the toolbar. |
The rest of the options are common for all the tool windows, seeTool window view modes.
Show comments for data sources and database objects
To enable descriptions for databases and tables, navigate to Descriptions in Tree Views.
and selectTo add comments for tables, select a table and press Ctrl+F6. In the Comment text field, add a table description.
To add comments for a database, open database settings Ctrl+Alt+S and add a database description in the Comment text field.
Icons for data sources and their elements
Icon | Description |
---|---|
Access Method | |
Aggregate | |
Alias Type | |
Argument | |
Body | |
Check | |
Cluster | |
Collation | |
Collection Type | |
Column. For more information about column icon combinations, see Possible icon combinations for columns. | |
Data File | |
Database | |
Read-only status | |
DDL data source | |
Default | |
Exception | |
Extension | |
External Schema | |
Foreign Data Wrapper | |
Foreign Key | |
Foreign Table | |
Index | |
Key | |
Materialized Log | |
Materialized View | |
Object Attribute | |
Object Type | |
Operator | |
Package | |
Projection | |
Read-only data sources | |
Role | |
Routine | |
Rule | |
Scheduled Event | |
Schema | |
Sequence | |
Server | |
Stored procedure or function | |
Synonym | |
Table | |
Table Type | |
Tablespace | |
Trigger | |
User | |
User Mapping | |
Variable | |
View | |
Virtual Table |
Possible icon combinations for columns
Icon | Foreign key | Primary key | Indexed | NOT NULL |
---|---|---|---|---|
Title bar context menu and buttons
You can right-click the window title bar and use the context menu to configure its viewing mode, associate the window with a different tool window bar, or resize and hide the window.
You can also use the toolbar buttons:
Item | Shortcut | Description |
---|---|---|
Ctrl+NumPad - | Collapse all expanded nodes in the current view. | |
Shift+Escape | Hide the tool window. To hide all the tool windows, press Ctrl+Shift+F12. |