RubyMine 5.4.0 Web Help

4.0+
4.0+

View | Tool Windows | Database

View | Tool Windows | Database

Use the Database tool window to manage your data sources and perform associated tasks.

The available data sources are shown as a tree of data sources, tables and table columns. If no data sources are currently defined, use the New command (Alt+InsertAlt+Insert) to create a data source.

Most of the functions in this window are accessed as context menu commands. Many of the commands have keyboard shortcuts. The Synchronize and Console commands can additionally be access by means of the title bar buttons (SynchronizeOnTitleBar and ConsoleOnTitleBar respectively).

The set of available functions depends, first of all, on the data source type (DB or DDL). For DB data sources you can, for example:

Irrespective of the data source type (DB or DDL), you can also:

On this page:

Context menu commands and shortcuts

IconCommandShortcutDescriptionAvailable for
imgNewAlt+InsertAlt+Insert Use this command to create a new data source, table, table column, index, or primary or foreign key. The list of options depends on which element is currently selected.

If a data source is selected, or if there are no data sources currently defined and nothing is selected, you can choose:

  • DataTables Table to create a new table for a selected DB data source. (This option is not available unless there is at least one DB data source defined.)
  • DataSource Data Source to create a new DB data source. Specify the properties of the new data source in the Data Source Properties dialog.
  • icon_SqlDataSource DDL Data Source to create a new DDL data source. Specify the properties of the new data source in the Data Source Properties dialog.
  • icon_DataSourceImport.png Import from sources to create one or more DB data sources by importing

    Select the files of interest (i.e. the data sources to be created) in the Import Data Sources dialog. (Prior to opening the dialog, RubyMine will scan your project to find the appropriate files.)

If a table in a DB data source is selected, you can choose:

  • dataColumn Column to create a column in the selected table.
  • DataTables Table to create a table.

If a table column or a number of columns in a DB data sources is selected, you can choose:

  • dataColumn Column to create a column.
  • DataTables Table to create a table.
  • dataIndex Index to create an index on the selected column or columns.
  • dataPrimaryKey Primary Key to define a primary key constraint on the selected column or columns.
  • dataForeignKey Foreign Key to define a foreign key constraint on the selected column or columns.
DB data sources and their elements (tables and table columns). If a DDL data source is selected, you can only choose to create another data source.
stopClose ConnectionDeleteDeleteUse this command to close the selected active database connection (shown as database_connection underneath the corresponding DB data source node).Active connections
deleteDrop Associated Use this command to remove constraints such as a primary key or a foreign key constraint. Choose:
  • dataPrimaryKey Primary Key to remove the corresponding primary key constraint. The command is available for a table or any of its columns if the table has a primary key.
  • dataForeignKey Foreign Key to remove the corresponding foreign key constraint. The command is available only for a column or columns on which a foreign key constraint is defined.
Tables and table columns in DB data sources
RenameShift+F6Shift+F6 Use this command to rename the selected data source, table or table column. Specify the new name in the dialog that opens.All node types except active connections
imgDuplicateCtrl+DCtrl+D Use this command to create a copy of the selected data source. Specify the properties of the data source in the Data Source Properties dialog that opens. See DB Data Source Properties or DDL Data Source Properties.DB and DDL data source nodes
Modify Column Ctrl+F6Ctrl+F6Use this command to edit the properties of the selected column.Table columns in DB data sources
Copy ReferenceCtrl+Alt+Shift+CCtrl+Alt+Shift+CUse this command to copy the fully qualified name of the selected data source, table or table column to the clipboard.All node types except active connections
DeleteDeleteDeleteUse this command to delete the selected data source, table or table column.All node types except active connections
Find UsagesAlt+F7Alt+F7 Use this command to find the usages of (references to) the selected item (data source, table or table column) in the project source files and libraries. All node types except active connections
showAllPAthsAffectedCompareCtrl+DCtrl+DSelect two data sources or tables and then use this command to compare the selected items. The differences are shown in Differences Viewer for Folders and DB Objects.DB and DDL data sources and tables
DataTables Table EditorF4F4Use this command to open the selected database table in the Table Editor.

See also, Manipulating Table Data in the Table Editor.

Tables and table columns in DB data sources
DataTables View Editor,
Function Editor,
Procedure Editor or
Package Editor
F4F4Use this command to open the definition of the selected view, function, procedure or package in the editor.Corresponding elements in DB data sources
DataTablesEdit SourceF4F4Use this command to open the associated DDL file in the editor.Tables and table columns in DDL data sources
runJdbcConsole.pngConsoleCtrl+Shift+F10Ctrl+Shift+F10 Use this command to open the database console for the corresponding DB data source. As a result, you'll be able to run DDL and DML SQL statements to manipulate data structures and data.DB data sources and their elements (tables and table columns)
imgSynchronizeCtrl+Alt+YCtrl+Alt+YUse this command to update the view of the selected element (i.e. to synchronize the view of the element with its actual state in the database).

Note that you can enable auto-synchronization for a DB data source by turning on the Auto sync option in the Data Source Properties dialog.

DB data sources and their elements (tables and table columns)
imgPropertiesEnterEnterUse this command to view or edit the properties of the selected data source in the Data Source Properties dialog. See DB Data Source Properties or DDL Data Source Properties. DB and DDL data source nodes
DDLCopyCopy DDLCtrl+Shift+CCtrl+Shift+CUse this command to copy a DDL definition of the selected data source, table or table column onto the clipboard.All node types except active connections
mainToolbarSaveSave to FileUse this command to save the selected table in a file, or to view or edit the export settings. Select:
  • Tab-separated Values (TSV) to save the table data in a text file in tab-separated values format.
  • Comma-separated Values (CSV) to save the table data in a text file in comma-separated values format.
  • HTML Table to save the data in an html file where the table is represented by the <table> element.
  • SQL Update Statements to save the data in a file where each row is represented by the corresponding UPDATE statement.
  • SQL Insert Statements to save the data in a file where each row is represented by the corresponding INSERT statement.
  • Export Settings to edit the data export settings. In the dialog that opens you can select whether you want the column names and row numbers to be included, and also specify how string values should be quoted in CSV and TSV files.
Tables in DB data sources
icon_UML.pngDiagramsCtrl+Shift+Alt+UCtrl+Shift+Alt+U
Ctrl+Alt+UCtrl+Alt+U
Use this command to see a UML class diagram for the selected data source or table. Select:
  • Show Visualisation to open the diagram on a separate editor tab.
  • Show Visualisation Popup to see the diagram in a pop-up window.
DB and DDL data sources and tables
Ctrl+QCtrl+Q Use this key combination to see basic information for the selected element. The information shown depends on the element type. For example, the following is shown for a table: the names of the data source, catalog, schema and the table itself. Also shown is the corresponding CREATE TABLE DDL statement and, if appropriate, the first 10 table rows.

To close the documentation pop-up, press EscapeEscape.

All node types except active connections

Icons for data sources and their elements

IconDescription
DataSource DB data source
database_connection.png Database connection for a DB data source (appears right underneath the corresponding data source node as soon as the connection is established).

RubyMine 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 stop Close Connection.

icon_SqlDataSource DDL data source
dataSchema.png Schema
DataTables Table
dataColumn Column
dataColumnNotNull A NOT NULL column
dataPkColumn.png Column with a primary key
dataFkColumn.png Column with a foreign key
dataIndexedColumn.png Column with an index
dataPrimaryKey Primary key
dataForeignKey Foreign key
dataIndex Index
dataView View
dataFunction Stored procedure or function

See Also

Language and Framework-Specific Guidelines:

Getting Started:

Web Resources: