Screens: ERD

Table node

A table node is one table placed on the ERD canvas. You edit the table's name and columns directly inside the node, and when you select the node, a toolbar above it saves or applies that one table. How saving differs from applying to the database is explained in ERDs and the real database.

Where you can use itWebDesktopWithout signing inSigned inLocal projectsAccount projects

What's on the screen

No.NameDescription
1Node toolbarAppears above the node when only one table is selected. See 'Node toolbar' below.
2Table nameEdit the name directly in the header of the selected table. Tables that are not selected show only the name, with the table comment on one line below it.
3Logical Name inputA human-readable name. If a data dictionary is assigned to the connection, the table name is generated from the logical name. See Data dictionary.
4× button and change markerThe × button removes the table from this ERD. It does not drop the table in the database. When there are unsaved changes, an orange dot appears in its place and turns back into the × button when you hover over it; clicking it then asks before removing the table without saving.
5Column gridOne row per column. Click or double-click a cell to edit it in place. See 'Columns of the grid' below.
6Add column buttonThe + button at the right of the grid header. Adds a new column at the bottom and opens its name cell.
7Delete column buttonAt the right end of each row. Deletes that column.

Columns of the grid

Which columns the grid shows, and in what order, is set with the Column Display item in the info panel (Info panel).

ColumnWhat it does
KeyA green key marks primary key columns and a red key marks foreign key columns. It cannot be edited.
Logical NameThe column's logical name. Hidden by default; it appears when you turn it on in the Column Display part of the info panel or click the Logical mode button.
ColumnThe column name. Renaming a column that exists in the database is recorded as a rename, not as a new column. Icons before the name mark a generated column, a case-preserved name, a sensitive column and a changed position.
Data TypeChoose from this DBMS's type list, or type a custom type and press Enter. Choosing ENUM or SET opens a window for the list of values. For spatial types, click the map marker in the cell to set the SRID and geometry type when the DBMS supports it.
DomainAppears only when a data dictionary domain is assigned to the connection. Choosing a domain copies its type to the column.
PKPrimary key. Turning it on also turns on N/N.
N/NNOT NULL. It cannot be turned off for a primary key column.
A/IAuto increment. Turning it on clears the default value. In a DBMS that allows only one auto-increment column, it is turned off on the other columns.
Default ValueThe default value. See 'Setting a default value' below. It cannot be edited on an auto-increment column.
RemarksThe column description. It is applied to the database as the column comment.

Markers in the header

MarkerMeaning
Schema name above the nodeThe schema the table belongs to. Turn it on and off with the Schema item in the info panel. This setting is stored on this device, not in the ERD.
Letter badge before the nameIn Databricks, Snowflake and BigQuery, shows a kind other than a regular table (external, temporary, snapshot and so on) in one or two letters. Hover over it to see the kind.
Aa iconA case-preserved name (see 'Preserving case' below).
Shield iconA PostgreSQL table with row-level security (RLS) turned on, or a table in a system schema that cannot be edited. Hover over it to see which.
Broadcast iconA table that belongs to a PostgreSQL publication.
Deleted TableA table marked for deletion. It is dropped on the next apply, and cannot be edited until then.

Node toolbar

It appears above the node when only one table is selected. It does not appear when several tables are selected, when the ERD is locked, or when the view is zoomed out so far that only table names show.

No.ButtonWhat it does
1Delete Table... buttonDeletes the table in the real database. You choose whether to only mark it for deletion or to DROP it right away. On a table marked for deletion it becomes the Cancel Table Deletion button.
2Apply Changes to DB... buttonBuilds DDL from this table's changes, shows it, and runs the statements you choose. See Apply changes to the database.
3Refresh buttonReads this table's current definition from the database again. Not available for a virtual table that does not exist in the database yet.
4Save buttonSaves this table's design to the project. The database does not change.
5Restore... buttonDiscards unsaved changes and returns to the last saved state. A table that was never saved returns to its state in the database.
6View in Detail Tab buttonOpens this table in a separate Table tab. This is a different screen from the Table detail panel below the canvas.
  • 2 and 3 are available only on a connection with database access details. 2 is available when there are changes not yet applied to the database, and 4 and 5 only when there are unsaved changes.

Adding and editing columns

  1. Click a table to select it. Only a selected table's name and columns can be edited.
  2. Click the + button at the right of the grid header. A new column appears at the bottom and its name cell opens. Pressing Ctrl+Enter (Cmd+Enter on macOS) in a grid cell inserts another column below the current row.
  3. Type the name and move across with Tab to set Data Type, PK, N/N, Default Value and Remarks.
  4. Click the Save button in the node toolbar to save the design.

Newly added columns show in green and changed cells in blue. The colors disappear when you apply the changes to the database.

  • Drag a column row to reorder columns. MySQL and MariaDB can also reorder columns that exist in the database. Other DBMSs cannot reorder existing columns, so you can only move columns of a virtual table, or newly added columns among themselves.
  • To delete a column, click the delete button at the end of its row, or select the row and press Delete. If the column is used by a foreign key, you are asked whether to delete it together with that foreign key. A column that exists in the database is actually dropped when you apply the changes.

Setting a default value

Double-click the Default Value cell to open an input with three mode buttons.

ModeMeaningExample
ValueA literal value. For character types it is quoted in the DDL.N, 0
ExpressionAn SQL expression. It goes into the DDL as is, without quotes. It cannot be empty.CURRENT_TIMESTAMP
Not SetNo default value. Typing in this mode switches to Value mode.

Expression defaults are shown in the grid in faint purple italics.

Creating a generated column

A generated column is computed from an expression instead of storing a value you enter.

  1. Select the column rows to convert. Hold Ctrl (Cmd on macOS) or Shift while clicking to select several rows.
  2. Right-click the selected rows and choose the ERD table context menuSet as Generated Column menu. If the DBMS supports both kinds, choose VIRTUAL or STORED in the submenu.
  3. Type the expression in that column's Default Value cell.
  • Converting a column clears its default value and auto increment. A purple calculator icon appears before the name, and the Default Value cell shows AS (expression).
  • Oracle uses only VIRTUAL, and PostgreSQL and H2 use only STORED.
  • To turn it back into a regular column, choose the ERD table context menuUnset Generated Column menu.

Preserving case

PostgreSQL stores names created without quotes in lower case, and Oracle and Snowflake in upper case. To keep a name exactly as you typed it, mark it as case-preserved so it is quoted.

  • Right-click the table header and choose the ERD table context menuPreserve Case (table name) menu to preserve the table name, or right-click column rows and choose the ERD table context menuPreserve Case menu to preserve column names. A preserved name shows the Aa icon.
  • To undo, use the ERD table context menuDon't Preserve Case (table name) and ERD table context menuDon't Preserve Case menus. The name is changed to the case it will be stored in, and if that collides with another name, preservation is kept.
  • Only names still being designed can be marked. The table menu appears on a virtual table, and the column menus on columns of a virtual table or newly added columns.
  • The menus appear for PostgreSQL, Oracle and Snowflake, and for H2 when the connected database changes the case of names.

Copying and pasting

Copy or cut tables and columns and paste them elsewhere. The keys are Ctrl+C, Ctrl+X and Ctrl+V (Cmd on macOS). If column rows are selected, the columns are copied; otherwise the selected tables are.

  1. Select a table or column rows and press Ctrl+C (Cmd+C on macOS). The copied table or rows keep a source marker.
  2. For tables, point at the place on the canvas and press Ctrl+V, or right-click an empty area and choose the ERD canvas context menuPaste Table menu. For columns, select the receiving table and press Ctrl+V, or right-click that table and choose the ERD table context menuPaste Columns menu.
  3. If what you copied has foreign keys, you are asked whether to paste them as well.
  • Within the same connection you can paste into another ERD, another schema or another database. You cannot paste across connections.
  • When you paste a table that is in a schema this ERD covers and is not in this ERD yet, only the node is added. Otherwise a new virtual table is created in the target schema, and renamed if the name is taken.
  • A cut table leaves its original ERD when you paste it. The table in the database is not dropped. Cut columns are deleted from the original table when you paste them.
  • Pasting empties the clipboard. Pressing Esc empties it too.

Saving, restoring and refreshing

  • The Save button saves only this table's design. The Save button in the info panel saves the ERD and every changed table.
  • When you click the Refresh button and the table has changes not yet applied to the database, you choose between the Merge button and the Replace button. The Replace button discards all changes, resets the table to the database state and saves it. The Merge button takes the current structure from the database while keeping the entity settings for code generation, and does not save. Tables linked by foreign keys are read again too.

Right-click menu

Right-clicking a table header or column row shows the menu below. Only the items that apply to what you selected and to the table's state appear. If several tables are selected and you right-click one of them, the menu applies to all selected tables and the item names show the count.

MenuWhat it does
ERD table context menuView in Detail TabSame as the button in the node toolbar. Opens the table in a separate tab.
ERD table context menuPreserve Case (table name)Preserves the case of a virtual table's name (see 'Preserving case' above).
ERD table context menuDon't Preserve Case (table name)Stops preserving the case of the table name.
ERD table context menuCopy TableCopies the table.
ERD table context menuCut TableCuts the table. It leaves this ERD when you paste it.
ERD table context menuCopy ColumnsCopies the selected column rows.
ERD table context menuCut ColumnsCuts the selected column rows. They are deleted from this table when you paste them.
ERD table context menuPaste ColumnsPastes copied or cut columns into this table. Appears only for columns from the same connection.
ERD table context menuDelete ColumnsDeletes the selected columns.
ERD table context menuSet as Generated ColumnConverts the selected columns to generated columns (see 'Creating a generated column' above).
ERD table context menuUnset Generated ColumnTurns generated columns back into regular columns.
ERD table context menuPreserve CasePreserves the case of the selected column names.
ERD table context menuDon't Preserve CaseStops preserving the case of the column names.
ERD table context menuSaveSame as the button in the node toolbar. Appears only when there are unsaved changes.
ERD table context menuRestore...Same as the button in the node toolbar. Appears only when there are unsaved changes.
ERD table context menuRefreshSame as the button in the node toolbar. Does not appear on a virtual table.
ERD table context menuDelete Table...Same as the button in the node toolbar. Deletes the table in the real database.
ERD table context menuCancel Table DeletionCancels the deletion mark. Appears only on a table marked for deletion.
ERD table context menuMark as sensitiveMarks the right-clicked column as sensitive. On a column already marked, the Unmark sensitive menu appears instead. Appears only under the conditions in the box below.
ERD table context menuRemove from ERDRemoves the table from this ERD. The table in the database is left as is.
  • The menu that applies changes to the database is explained in Apply changes to the database, and the menu that generates sample data with AI in AI in the editor and ERD.
  • On tables in a system schema, the copy, cut, paste, delete, generated column and case menus do not appear.

Things to keep in mind

  • The × button and the ERD table context menuRemove from ERD menu only take the table out of the ERD diagram. The Delete Table... button deletes the table in the real database. The difference is explained in ERDs and the real database.
  • Choosing the Replace button after the Refresh button discards every change not yet applied to the database.
  • When you zoom far out, only table names show and the node toolbar disappears. To edit, zoom in or turn off the Zoom out item in the info panel. This setting is stored on this device, not in the ERD.
  • If the ERD is locked or the table is in a system schema, its name and columns cannot be edited, and the × button and node toolbar do not appear.
  • ERD canvas: Place tables, draw relationships and arrange the diagram.
  • Table detail panel: Edit the selected table's comment, foreign keys, indexes and constraints below the canvas.
  • Info panel: Choose the grid columns, the display mode and the zoomed-out view.
  • Apply changes to the database: Preview and run the generated DDL.
  • Table tab: The separate tab opened by the View in Detail Tab button.