PhpStorm 7.0.0 Web Help

2.0+

You can add, remove and modify table records by running SQL statements in the Database console or in the editor. You can also edit the records retrieved from tables in the Results pane.

Besides these facilities, PhpStorm also features the Table Editor which provides a graphical interface for manipulating table data.

Note

The Table Editor is available only for DB data sources.

Opening a table in the table editor
  1. In the Database tool window, select the table of interest.
  2. Do one of the following:
    • Press F4F4F4F4F4F4F4F12 or Ctrl+Shift+ECommand Down or F4F4F3.
    • Select open_table_editor Table Editor from the context menu.

As a result, the table opens in the Table Editor on a separate editor tab.

Navigating through the ranges of table rows

For tables containing many records, normally, not all but only a certain number of rows is shown at a time. This fixed number of rows displayed simultaneously is referred to as a page.

To navigate through the pages, use the following toolbar buttons, context menu commands, or keyboard shortcuts:

  • dataSourceTableEditorFirstPage.png   First Page. Go to the first of the pages.
  • dataSourceTableEditorPreviousPage   Previous Page (Ctrl+Alt+UpCtrl+Alt+UpCtrl+Alt+UpCtrl+Alt+UpCtrl+Alt+UpCtrl+Alt+UpCtrl+Alt+UpCtrl+Alt+UpAlt Command UpAlt Command UpAlt Command Up). Go to the previous page.
  • dataSourceTableEditorNextPage.png   Next Page (Ctrl+Alt+DownCtrl+Alt+DownCtrl+Alt+DownCtrl+Alt+DownCtrl+Alt+DownCtrl+Alt+DownCtrl+Alt+DownCtrl+Alt+DownAlt Command DownAlt Command DownAlt Command Down). Go to the next page.
  • dataSourceTableEditorLastPage.png   Last Page. Go to the last of the pages.
Showing and hiding table columns

Do one of the following:

  • Right-click the header row, and then click the name of the column which you want to hide or show.
  • Click filter.png Filters and Ordering on the toolbar of the Table Editor, or press Ctrl+F12Ctrl+F12Ctrl+0Ctrl+F12Ctrl+F12Ctrl+F12Ctrl+F12 or Ctrl+Shift+F12Ctrl+F3 or Ctrl+OCommand F12Command F12Command O.

    In the Filters and Ordering dialog, use the check boxes in the first (leftmost) column to control visibility of the table columns.

Sorting and filtering data
  1. Do one of the following:
    • Press Ctrl+F12Ctrl+F12Ctrl+0Ctrl+F12Ctrl+F12Ctrl+F12Ctrl+F12 or Ctrl+Shift+F12Ctrl+F3 or Ctrl+OCommand F12Command F12Command O.
    • Click filter.png Filters and Ordering on the toolbar of the Table Editor.
    • Select Filters and Ordering from the context menu.

    The Filters and Ordering dialog that opens shows the list of table fields.

    filterAndOrdering.png

  2. Use the check boxes in the first (leftmost) column to specify which fields should be shown or hidden. (The fields next to the check boxes that are not selected will be hidden.)
  3. You can have the records sorted by one or more visible fields. Use the lists in the Order column to define how the data should be ordered.

    The hyphens (-) mean that no ordering rules are specified for the corresponding fields.

    asc stands for ascending, desc - for descending.

    The number in front of asc or desc means the ordering priority.

    filterSortingOrder.png

  4. Use the Filter column to specify conditions for filtering the records. You can specify filtering conditions for several fields.

    To define a filtering condition for a field, double-click the Filter cell next to the field name, type the condition, and then click a different cell or press EnterEnterEnterEnterEnterEnterEnterEnterEnterEnterEnter.

    filterCriteria.png

  5. Click OK in the Filters and Ordering dialog to apply the specified settings to the table.
Editing fields and uploading files
  1. To start editing a field, double-click the corresponding table cell.
  2. Edit the cell contents. To do that, you have the following options:
    • Modify the data right in the cell. To save the changes, press EnterEnterEnterEnterEnterEnterEnterEnterEnterEnterEnter.
    • Click browseButton.png or press Shift+EnterShift+EnterShift+EnterShift+EnterShift+EnterShift+EnterShift+EnterShift+EnterShift EnterShift EnterShift Enter to open the Enter text data or choose file dialog. In this dialog you can:
      • Make the necessary edits in the upper area.
      • Upload a file into the field. To do that, click Browse and select the desired file in the Choose Path dialog.
      • Insert null into the field (click Null).
  3. To leave the editing mode, click a different cell or press EscapeEscapeEscapeEscapeEscape, Escape or Ctrl+GEscapeEscapeEscapeEscapeEscapeEscape.
Adding a record to a table
  1. Do one of the following:
    • Press Alt+InsertAlt+InsertAlt+InsertAlt+InsertAlt+InsertAlt+InsertAlt+Insert or Ctrl+NAlt+InsertCommand N or Control EnterControl N or Control EnterCommand N or Control Enter.
    • Click add.png Add New Row on the toolbar of the Table Editor.
    • Select Add New Row from the context menu.
  2. Fill in the fields. Use the EnterEnterEnterEnterEnterEnterEnterEnterEnterEnterEnter or the TabTabTabTabTabTabTabTabTabTabTab key to indicate the end of your input in the current cell and move on to the next cell. The new record is saved when you press EnterEnterEnterEnterEnterEnterEnterEnterEnterEnterEnter or TabTabTabTabTabTabTabTabTabTabTab in the last of the cells.
Deleting records
  1. Select the row or rows that you want to delete. To do that:
    • If you are going to delete one row, select any of the cells within the corresponding row.
    • If you are going to delete a range of rows, select one or more cells in each of the corresponding rows.

      Note

      You can select only the rows that follow one another.

  2. Do one of the following:
    • Press Ctrl+YCtrl+YCtrl+YCtrl+YCtrl+YCtrl+Shift+LCtrl+ECtrl+DCommand BackspaceCommand YCommand D.
    • Click delete.png Delete Selected Rows on the toolbar of the Table Editor.
    • Select Delete Selected Rows from the context menu.
  3. Confirm your intention to delete the selected row or rows by clicking OK in the corresponding dialog.
Setting the number of rows to display simultaneously
  1. Do one of the following:
    • Click properties.gif Properties on the toolbar of the Table Editor.
    • Select Properties from the context menu.
  2. In the Table Editor Properties dialog, select the General tab.
  3. In the Page Size field, specify the number of rows to display simultaneously. For all table rows to be shown at the same time, type zero.
  4. Click OK.
  5. Optionally, if you want to apply the new page size setting to the current table view, do one of the following:
    • Press Ctrl+RCtrl+RCtrl+RCtrl+RCtrl+RCtrl+RCtrl+RCtrl+RConsole.TableResult.ReloadCommand RConsole.TableResult.Reload.
    • Click refresh.png Reload Page on the toolbar of the Table Editor.
    • Select Reload Page from the context menu.
Specifying data export format

The data export format is the format of data copied from a table to the clipboard. To define this format:

  1. Do one of the following:
    • Click properties.gif Properties on the toolbar of the Table Editor.
    • Select Properties from the context menu.
  2. In the Table Editor Properties dialog, select the Data Export tab.
  3. In the String Quotation fields, specify the characters that should be used to enclose the exported string values.

    Note

    The characters preceding and following the string values may be different. That's why two separate fields are provided.

  4. In the Values Separator field, specify the character or characters to be used to separate exported values.
  5. If you want to include the table header (column names) in exported data, select the Include Table Header check box.
  6. If you want to include the row numbers in exported data, select the Include Row Number check box.
  7. Click OK.
Copying table data to the clipboard

You can copy the data contained in selected table fragments to the clipboard. To do that:

  1. Select the table fragment of interest. This may be a cell, a row, a range of cells or rows, or all rows currently shown.
  2. Do one of the following:
    • Press Ctrl+C or Ctrl+InsertCtrl+C or Ctrl+InsertCtrl+C or Ctrl+InsertCtrl+C or Ctrl+InsertCtrl+Insert, Alt+C or Escape, WCtrl+C or Ctrl+InsertCtrl+C or Ctrl+InsertCtrl+C or Ctrl+InsertCommand C or Command InsertCommand C or Command InsertCommand C or Command Insert.
    • Click copy.gif Copy on the toolbar of the Table Editor.
    • Select Copy from the context menu.

As a result, the selected data are copied to the clipboard. The data format corresponds to the data export format currently specified.

Copying queries to the clipboard

You can copy the SQL statement that resulted in generating the current table view to the clipboard.

Do one of the following:

  • Press Ctrl+Shift+Alt+CCtrl+Shift+Alt+CCtrl+Shift+Alt+CCtrl+Shift+Alt+CCtrl+Shift+Alt+CCtrl+Shift+Alt+CCtrl+Shift+Alt+CCtrl+Shift+Alt+CShift Alt Command CShift Alt Command CShift Alt Command C.
  • Click icon_sqlCopyQuery.png Copy Query on the toolbar of the Table Editor.
  • Select Copy Query from the context menu.
Saving large objects (lobs) in files

You can save large objects (LOBs) stored in database tables in local files. To do that:

  1. Select the cell containing the large object of interest.
  2. Do one of the following:
    • Click mainToolbarSave.gif Save LOB As on the toolbar of the Table Editor.
    • Select Save LOB As from the context menu.
  3. In the Select File to Save dialog:
    1. Specify the destination directory in the upper part.
    2. Type the name of the file File name field.
    3. Click OK.
Refreshing a table view

You may want to refresh the view of a table in the Table Editor in order to:

  • Synchronize the data shown with the actual contents of the table in the database.
  • Apply the changed page size setting to the current table view.

In all such cases, use the Reload Page command:

  • Press Ctrl+RCtrl+RCtrl+RCtrl+RCtrl+RCtrl+RCtrl+RCtrl+RConsole.TableResult.ReloadCommand RConsole.TableResult.Reload.
  • Click refresh.png Reload Page on the toolbar of the Table Editor.
  • Select Reload Page from the context menu.

See Also

Language and Framework-Specific Guidelines:

Reference:

Web Resources: