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.
What's on the screen
| No. | Name | Description |
|---|---|---|
| 1 | Node toolbar | Appears above the node when only one table is selected. See 'Node toolbar' below. |
| 2 | Table name | Edit 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. |
| 3 | Logical Name input | A 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 marker | The × 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. |
| 5 | Column grid | One row per column. Click or double-click a cell to edit it in place. See 'Columns of the grid' below. |
| 6 | Add column button | The + button at the right of the grid header. Adds a new column at the bottom and opens its name cell. |
| 7 | Delete column button | At 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).
| Column | What it does |
|---|---|
| Key | A green key marks primary key columns and a red key marks foreign key columns. It cannot be edited. |
| Logical Name | The 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. |
| Column | The 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 Type | Choose 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. |
| Domain | Appears only when a data dictionary domain is assigned to the connection. Choosing a domain copies its type to the column. |
| PK | Primary key. Turning it on also turns on N/N. |
| N/N | NOT NULL. It cannot be turned off for a primary key column. |
| A/I | Auto 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 Value | The default value. See 'Setting a default value' below. It cannot be edited on an auto-increment column. |
| Remarks | The column description. It is applied to the database as the column comment. |
Markers in the header
| Marker | Meaning |
|---|---|
| Schema name above the node | The 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 name | In 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 icon | A case-preserved name (see 'Preserving case' below). |
| Shield icon | A 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 icon | A table that belongs to a PostgreSQL publication. |
| Deleted Table | A 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. | Button | What it does |
|---|---|---|
| 1 | Delete Table... button | Deletes 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. |
| 2 | Apply Changes to DB... button | Builds DDL from this table's changes, shows it, and runs the statements you choose. See Apply changes to the database. |
| 3 | Refresh button | Reads this table's current definition from the database again. Not available for a virtual table that does not exist in the database yet. |
| 4 | Save button | Saves this table's design to the project. The database does not change. |
| 5 | Restore... button | Discards unsaved changes and returns to the last saved state. A table that was never saved returns to its state in the database. |
| 6 | View in Detail Tab button | Opens 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
- Click a table to select it. Only a selected table's name and columns can be edited.
- 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+Enteron macOS) in a grid cell inserts another column below the current row. - Type the name and move across with
Tabto set Data Type, PK, N/N, Default Value and Remarks. - 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.
| Mode | Meaning | Example |
|---|---|---|
| Value | A literal value. For character types it is quoted in the DDL. | N, 0 |
| Expression | An SQL expression. It goes into the DDL as is, without quotes. It cannot be empty. | CURRENT_TIMESTAMP |
| Not Set | No 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.
- Select the column rows to convert. Hold
Ctrl(Cmdon macOS) orShiftwhile clicking to select several rows. - Right-click the selected rows and choose the menu. If the DBMS supports both kinds, choose
VIRTUALorSTOREDin the submenu. - 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 onlySTORED. - To turn it back into a regular column, choose the 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 menu to preserve the table name, or right-click column rows and choose the menu to preserve column names. A preserved name shows the
Aaicon. - To undo, use the and 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.
- Select a table or column rows and press
Ctrl+C(Cmd+Con macOS). The copied table or rows keep a source marker. - For tables, point at the place on the canvas and press
Ctrl+V, or right-click an empty area and choose the menu. For columns, select the receiving table and pressCtrl+V, or right-click that table and choose the menu. - 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
Escempties 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.
| Menu | What it does |
|---|---|
| Same as the button in the node toolbar. Opens the table in a separate tab. | |
| Preserves the case of a virtual table's name (see 'Preserving case' above). | |
| Stops preserving the case of the table name. | |
| Copies the table. | |
| Cuts the table. It leaves this ERD when you paste it. | |
| Copies the selected column rows. | |
| Cuts the selected column rows. They are deleted from this table when you paste them. | |
| Pastes copied or cut columns into this table. Appears only for columns from the same connection. | |
| Deletes the selected columns. | |
| Converts the selected columns to generated columns (see 'Creating a generated column' above). | |
| Turns generated columns back into regular columns. | |
| Preserves the case of the selected column names. | |
| Stops preserving the case of the column names. | |
| Same as the button in the node toolbar. Appears only when there are unsaved changes. | |
| Same as the button in the node toolbar. Appears only when there are unsaved changes. | |
| Same as the button in the node toolbar. Does not appear on a virtual table. | |
| Same as the button in the node toolbar. Deletes the table in the real database. | |
| Cancels the deletion mark. Appears only on a table marked for deletion. | |
| Marks 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. | |
| Removes 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 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.
Related screens
- 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.