DataGrip 2019.1 Help

Data editor

From the Database tool window (for any table within a DB data source):

  • DataTables on the toolbar (if the toolbar is not currently hidden)

  • Open Editor from the context menu

  • F4

Overview

The data editor provides a GUI for working with table data. It lets you sort, filter, add, edit and remove the data as well as perform other, associated tasks.

DBDataEditor00

Toolbar controls, context menu commands for data cells and keyboard shortcuts

Most of the available functions are accessed by means of controls on the toolbar, context menu commands for the data cells, and associated keyboard shortcuts.

Item

Shortcut

Description

dataSourceTableEditorFirstPage, dataSourceTableEditorPreviousPage, dataSourceTableEditorNextPage and dataSourceTableEditorLastPage

These icons and corresponding commands are for switching between the result set pages, i.e. the pages that show the table data.

A fixed number of rows shown simultaneously is referred to as a result set page. If this number is less than the number of rows in the table, only a subset of all the rows is shown at a time.

In such cases, you can use dataSourceTableEditorFirstPage, dataSourceTableEditorPreviousPage, dataSourceTableEditorNextPage and dataSourceTableEditorLastPage to switch between the subsets. (If all the rows are currently shown, these icons and the corresponding commands are inactive.)

The result set page size is set on the Database page of the Settings dialog.

dataSourceTableEditorFirstPage First Page

Use this icon or command to switch to the first of the result set pages to see the first series of rows.

dataSourceTableEditorPreviousPage Previous Page

Ctrl+Alt+Up

Use this icon, command or shortcut to switch to the previous result set page to see the previous series of rows.

dataSourceTableEditorNextPage Next Page

Ctrl+Alt+Down

Use this icon, command or shortcut to switch to the next result set page to see the next series of rows.

dataSourceTableEditorLastPage Last Page

Use this icon or command to switch to the last of the result set pages to see the last series of rows.

icons actions refresh svg Reload Page

Ctrl+F5 Use this icon, command or shortcut to refresh the current table view. Use this function to:
  • Synchronize the data shown with the actual contents of the database.

  • Apply the Result set page size setting after its change.

DBAddRow Add New Row

Alt+Insert Use this icon, command or shortcut to add a new row to the table.

Complete entering a value into a cell by pressing Enter. To save the new row, select Submit New Row from the context menu or press Ctrl+Enter.

See also, .

DBDeleteRows Delete Rows

Ctrl+Y Use this icon, command or shortcut to delete the selected row or rows.

Rows are selected by clicking the cells in the column where the row numbers are shown. To select more than one row, use mouse clicks in combination with the Ctrl key.

buttonTransactionControlDB Tx and Tx Isolation

Select the isolation level for database transactions and the way the transactions are committed.

  • Auto. The current transaction is committed automatically when you submit your local changes to the database server.

  • Manual. The changes submitted to the database server are accumulated in a transaction that can either be committed or rolled back.

iconDBSubmit Submit

Ctrl+Enter

Submit local changes to the database server. See Submit changes manually.

iconDBCommitTransaction Commit

Commit the current transaction. See also, Tx.

iconDBRollbackTransaction Rollback

Roll back the current transaction. See also, Tx.

icons actions suspend svg Cancel Query

Ctrl+F2

Use this icon or shortcut to terminate execution of the current query.

icons actions diff svg Compare With

Use this icon to compare the current table with another table. The tables open in the data editors and ones shown in the Database Console tool window are suggested for comparison.

DataExtractorButton Data Extractor: <current_format>

Use this button or command to open a menu in which you can select an output format for your data.

In addition to output formats, there are also the following options and commands:

  • Allow Transposition. For delimiter-separated values formats (TSV, CSV): If the table is shown transposed and you are copying selected cells or rows to the clipboard (e.g.Ctrl+C), the selection is copied transposed (as shown) if the option is on and non-transposed (as in the original table) otherwise.

  • Skip Generated Columns (SQL). For SQL INSERTs and UPDATEs: When copying or saving data, don't include auto-increment fields.

  • Add Table Definition (SQL). For SQL INSERTs and UPDATEs: When copying or saving data, add the table definition (CREATE TABLE).

  • Configure CSV Formats. Open the CSV Formats dialog that lets you manage your delimiter-separated values formats (e.g. CSV, TSV).

  • Go to Scripts Directory. Switch to the directory where the scripts that convert table data into various output formats are stored.

downloadArtifacts Dump Data | To Clipboard

Use this command to copy the table data onto the clipboard.

downloadArtifacts Dump Data | To File

Use this command to save the table data in a file. In the dialog that opens, specify the location and name of the file.

iconExportToDB Export to Database

Export the data to another table, schema or database. Select the target schema (a new table will be created) or table (the data will be added to the selected table). In the dialog that opens, specify the data mapping info and the settings for the target table.

View Query

Use this button to view the query which was used to generate the current table view. To close the pane where the query is shown, press Escape.

IconDBToolbarMenu This icon provides access to the following commands:
  • Transpose. Turn the transposed table view on or off. (In the transposed view, the rows and columns are interchanged. So, the rows are shown as columns and vice versa.)

  • Reset View. Restore the initial table view after reordering or hiding the columns, or sorting the data.

  • Sort via ORDER BY. Turn the corresponding option on or off.

    If the Sort via ORDER BY option is on, all the sorting operations that you perform are reflected in the corresponding SELECT statement (an ORDER BY clause is added or modified) which is executed immediately. As a result, the data for the whole table is sorted by the corresponding database system.

    Don't turn this option on if you want to keep interactions with the database to a minimum (e.g. when the table is very big or the database connection is "slow").

    If this option is off, the data is sorted "locally" by DataGrip and only for the rows currently shown.

  • Row Filter. Show or hide the filter box.

  • Settings. Open the Database page of the Settings dialog to view or edit the settings for your database consoles, data editors and the Database tool window.

Edit

F2 Use this command or shortcut to start editing a value in the selected cell or cells. (Alternatively, you can double-click the cell or simply start typing.)

To open the value completion suggestion list, press Ctrl+Space. To enter the modified value, press Enter. To cancel editing, press Escape.

See also, and .

Edit Maximized

F2 Maximize the selected cell and start editing a value in it.

When working in a maximized cell, use Enter to start a new line and Ctrl+Enter to enter the value. To restore an initial value and quit the editing mode, press Escape.

See also, .

Set DEFAULT

Ctrl+Alt+D

If appropriate: Set the default value or values.

Set NULL

Ctrl+Alt+N

If appropriate: Replace the value or values with null.

Load File

If appropriate: Load a file into the field.

Revert

Ctrl+Z

Revert the changes within the selection. See .

Clone Row

Ctrl+D

Use this command or shortcut to create a copy of the selected row.

Quick Documentation

Ctrl+Q

Use this command or shortcut to open the quick documentation view. To close the view, press Escape. For more information, see .

Transpose

Turn the transposed table view on or off. Alternatively, use IconDBToolbarMenu | Transpose.

Go To | Row

Ctrl+G

Use this command or shortcut to switch to a specified row. In the dialog that opens, specify the row number to go to.

Go To | Related Data

F4 Use this command or shortcut to switch to a related record. The command options are a combination of those for Go To | Referenced Data and Go To | Referencing Data.

The command is not available if there are no related records.

Go To | Referenced Data

Ctrl+B Use this command or shortcut to switch to a record that the current record references. If more than one record is referenced, select the target record in the popup that appears.

The command is not available if there are no referenced records.

Go To | Referencing Data

Alt+F7 Use this command or shortcut to see the records that reference the current record. In the popup that appears there are two categories for the target records:
  • First Referencing Row. All the rows in the corresponding table will be shown and the first of the rows that references the current row will be selected.

  • All Referencing Rows. Only the rows that reference the current row will be shown.

The command is not available if there are no records that reference the current one.

Filter by

Use this command to access quick filtering options. The options include those for the current column name and depend on the value in the current cell.

Copy

Ctrl+C

Copy the selection onto the clipboard. See also, .

Paste

Ctrl+V

Paste the contents of the clipboard into the table. See also, .

Save LOB

Use this command to save the large object (LOB) currently selected in the table in a file.

Alt+J, Shift+Alt+J, Ctrl+W

See .

Sorting data

To sort table data in a column, click the cell in the header row.

State

Description

No sorting

Indicates that the data is not sorted in this column. The initial state of the sorting marker.

Ascending order

The data is sorted in the ascending order. The number to the right of the marker (1 on the picture) is the sorting level. You can sort by more than one column. In such cases, different columns will have different sorting levels.

Descending order

The data is sorted in the descending order.

Here is an example of a table where data are sorted by two of its columns.

TableEditorSortedTable

To restore the initial "unsorted" state for the table, click IconDBToolbarMenu and select Reset View. See also, Sort via ORDER BY.

Reordering columns

To reorder columns, use drag-and-drop for the corresponding cells in the header row.

Hiding and showing columns

To hide a column, right-click the corresponding header cell and select Hide column.

To show a hidden column:

  1. Do one of the following:
    • Right-click any of the cells in the header row and select Column List.

    • Press Ctrl+F12.

    In the list that appears, the names of hidden columns are shown struck through.

    TableResultPaneHideColumn
  2. Select (highlight) the column name of interest and press Space.

  3. Press Enter or Escape to close the list.

To show all the columns, click IconDBToolbarMenu and select Reset View.

See also, .

See Also