Screens: Connections and explorer

Table tab

The table tab opens a single table as a work document tab. On a wide screen you edit its columns, foreign keys, indexes and constraints, and view its data and DDL. What you edit here is the same design as the same table in the ERD, and saving does not change the database. ERDs and the real database explains how saving differs from applying to the database.

Where you can use itWebDesktopWithout signing inSigned inLocal projectsAccount projects

What's on the screen

No.NameDescription
1Inner tabsThe vertical tabs on the left. See 'Inner tabs' below. When there are unsaved changes, a dot appears next to the Schema Editor tab.
2Table nameShown as schema : table. In PostgreSQL, a shield icon marks a table with row-level security (RLS) enabled, and a broadcast icon marks a table in a publication.
3Table buttonsThe Delete Table..., Apply Changes to DB... and Refresh buttons. They change with the inner tab you open. See 'Toolbar' below.
4Save and restore buttonsThe Save button saves the design to the project, and the Restore... button discards unsaved changes. They can be clicked only when there are unsaved changes.
5Database Table InformationDatabase, schema, table name, description, logical name and DBMS-specific options.
6Table ColumnsThe column grid. Its fields are the same as in the ERD's Table node; the fields only this tab has are described under 'Column grid' below.
7Foreign Keys, Indexes, ConstraintsTables of foreign keys, indexes and constraints. Add one with the button in the area header and delete one with the button at the end of its row.
  • Click an area's title to scroll to that area.
  • The status bar at the bottom shows the table's connection, database and schema, and on the Data tab also the number of rows read.

Inner tabs

TabWhen it appearsWhat it does
Schema EditorAlwaysEdits the table definition. This tab is shown when the table tab first opens.
Code GeneratorWhen template packs are assigned to the projectThe entity settings for generating source code from this table. See Generating source code.
DataAlwaysQueries and edits the table's data (see 'Viewing and editing data' below).
PropertiesA table in the database on DatabricksShows the properties of a Delta table and edits the supported ones.
DDLAlwaysShows the table's CREATE statement (see 'Viewing the DDL' below).
Version HistoryA Delta table on DatabricksShows the table's version history, previews the data of a past version or restores the table to it.
MetadataDBMSs whose database provides table metadata, such as Databricks, Snowflake and BigQueryShows metadata such as owner, creation time and storage format, read-only.

Toolbar

Open tabButtonWhat it does
Schema EditorDelete Table...Deletes the table (see 'Deleting a table' below). On a table marked for deletion it becomes the Cancel Table Deletion button.
Schema EditorApply Changes to DB...Builds DDL from this table's changes, shows it and runs it. It is the same window as Apply changes to the database.
Schema EditorRefreshReads the table's current information from the database again. It cannot be clicked on a virtual table that is not in the database yet.
Code GeneratorGenerate Source Code..., Reset Entity Settings...Generates source code, and resets the entity settings. See Generating source code.
DataRefreshQueries the data again.
  • The Apply Changes to DB... and Refresh buttons work only on a connection with database access details. The Apply Changes to DB... button can be clicked only when there are changes not yet applied to the database.
  • The save and restore buttons (4) are hidden on the Data tab, the DDL tab and the three Databricks tabs.

Opening a table tab

  1. Double-click a table in the explorer. The table tab (Document tabTable) for that table opens. If it is already open, you move to that tab.
  2. To open it from an ERD, select the table node and click the View in Detail Tab button in the node toolbar.
  • When it first opens, the tab reads the table's columns, keys and indexes from the database. If that fails, an error and a Retry button appear.
  • Double-clicking a view opens an object tab, not a table tab (Object tabs).

Creating a new table

  1. In the explorer, right-click a schema or the Tables item under it and click the Explorer context menuNew Table menu.
  2. A virtual table with an unused name such as table1 is created and its table tab opens. Type a name in the table name field.
  3. Define columns, foreign keys and indexes, and click the Save button.
  4. To create it in the database, click the Apply Changes to DB... button, check the CREATE TABLE statement and run it.
  • The new table is saved to the project as soon as it is created, but it is not in the database. It stays a virtual table until you apply it.
  • If the connection has a new table template, the table starts with those columns. Set the template in Create and edit a connection.
  • In DBMSs that change the case of names when storing them, such as PostgreSQL and Oracle, the default name uses that case too (TABLE1 in Oracle).
  • In a system schema the menu is dimmed and cannot be clicked.

Editing columns and keys

  1. In the Table Columns area (6), click the new column button or the + button on the right of the grid header to add a column.
  2. Click or double-click a field to set the name, type, PK, N/N, default value and description.
  3. Add foreign keys, indexes and constraints with the Add Foreign Key..., Add Index... and Add Constraint... buttons of each area (7).
  4. Click the Save button to save.

New columns, edited fields and moved columns are shown in color. When you change the column order, an Order Changed mark appears next to the Table Columns title. What each field does, default values, generated columns and case preservation are described in Table node, and the windows for adding foreign keys, indexes and constraints in Table detail panel. They are the same windows.

Column grid

The column grid uses the same fields as the ERD node, and this tab shows the following fields as well.

FieldWhen it appears
Logical NameAlways. In the ERD node it follows the display settings.
DomainWhen a data dictionary domain set is assigned to the connection
Charset, CollationMySQL and MariaDB. Sets the character set and collation per column. The ERD does not have these fields.

Fields of the table information

FieldDescription
DatabaseAppears only in DBMSs that keep databases and schemas separate. It cannot be edited.
SchemaIt cannot be edited.
Table NameThe table name. Renaming a table that exists in the database becomes a rename statement when you apply. For a virtual table in a DBMS that changes the case of stored names, a Preserve case item appears below it.
DescriptionThe table description. It goes to the database as the table comment.
Logical NameA human-readable name. On a connection with a data dictionary, the table name is built from the logical name. See Data dictionary.
DBMS-specific optionsFields that the DBMS provides, such as engine, character set and collation in MySQL and MariaDB, and tablespace in PostgreSQL and Oracle.

In PostgreSQL and Supabase, the Logical Replication and RLS Policies areas appear below the Constraints area. They are the same as the areas of the Table detail panel.

When you change the primary key

When you change a primary key that other tables' foreign keys reference and save, the Primary Key Change Preview — orders window opens before saving. A foreign key must have as many columns as its parent's primary key, so you decide how to align the child tables' foreign keys.

  1. Check the old and new primary keys at the top of the window.
  2. In the Affected foreign keys (1) table, choose what to do for each child table.
    • If you added a column to the primary key, type the name of the column to add to the child table in the New child column names field.
    • If you removed or replaced primary key columns, choose Drop FK constraint only or Manual mapping. With Manual mapping, type the child columns that pair with the new primary key.
  3. Click the Apply button. The child tables changed along with this table are saved too.
  • Closing the window does not save.
  • When you apply to the database, the child tables changed along with it are included in the DDL preview with the Auto-included mark, and cannot be removed.
  • If a foreign key of a table in the database references the primary key of a virtual table that is not in the database yet, the change cannot be applied. Apply the parent table to the database first.
  • Existing data is not migrated. Check beforehand for columns that become NOT NULL and for referenced data.

Viewing and editing data

Opening the Data tab queries the table's data. The result grid is the same as in the SQL editor.

  • It reads 200 rows first. Scroll to the end of the grid or click the Load More button below it to read 200 more rows.
  • Filtering, sorting and editing are described in Result grid and Editing result data. When you apply edits, UPDATE, INSERT and DELETE statements run on the database right away and the data is queried again. If a statement fails, you choose between the Stop, Retry and Skip buttons.
  • Tables and views without a primary key can be edited too. The rows to change are then found by the values of all columns, so before applying you are asked once with There is no primary key, so the rows to change are found by the values of all columns (orders_log). Other rows with the same values may change too.. The connection profile's protection mode confirmation is asked in the same window.
  • The Export button in the filter row exports the whole table's data to a file. See Exporting results.
  • On a connection without database access details, nothing is queried.

Viewing the DDL

The DDL tab shows the table's CREATE statement, read-only.

  • For a table in the database it is built from the database's current definition. Saved changes and changes in progress are not included, and a notice appears when there are such changes. Check the DDL with your edits in the preview of the Apply Changes to DB... button.
  • For a virtual table it is built from the design.
  • Turn on Include schema name to put the schema before the table name. In a non-default SQL Server schema it is always included.
  • Rebuild it with the Refresh button and copy it with the Copy SQL button.
  • Databricks shows the database's SHOW CREATE TABLE result as is.

Saving, restoring and applying

  1. After editing, click the Save button. The design is saved to the project, and the database does not change.
  2. To discard unsaved changes, click the Restore... button and confirm. The table returns to its last saved state.
  3. To create it in the database, click the Apply Changes to DB... button, check the statements in the preview and run them. See Apply changes to the database.
  • If you close the tab without saving, you are asked whether to save. Closing without saving returns the table to its last saved state.
  • When you click the Refresh button on a table with changes not applied to the database, you choose between the Merge and Replace buttons. It is the same as refreshing in the explorer, and is described in Table node.
  • In a signed-in account project, a member whose DDL execution is restricted requests approval instead of running it. See DDL approval.

Deleting a table

When you click the Delete Table... button, you are asked how to handle it depending on the table's state.

TableWhat it does
A virtual table not in the database yetDeletes it from the project. The tab closes.
A table in the databaseFlag Only (Keep in the database) only marks it for deletion and drops it at the next apply. Execute DROP TABLE (Delete from the database) previews the DROP TABLE statement and runs it.
A table marked for deletionPreviews the DROP TABLE statement and runs it.

A table marked for deletion cannot be edited, and the Deleted Table notice appears over the Schema Editor tab. Undo it with the Cancel Table Deletion button.

How it differs from the ERD detail panel

The Table detail panel below the ERD canvas edits the same table too. Both edit the same design, so what you change in one appears in the other right away.

Table tabERD detail panel
Opened fromDouble-clicking a table in the explorer, or the View in Detail Tab button of an ERD nodeClicking a table node on the ERD canvas
ColumnsThe column grid in the tab, with per-column character set (MySQL and MariaDB) and logical name fieldsEdited in the node on the canvas
Saving and applyingThe tab's buttonsThe node toolbar and info panel buttons
Code generation and Databricks tabsYesNo
Node color and notesNoIn the NeoSQL Properties area

Things to keep in mind

  • The Save button does not change the database. The table that the explorer and other people see in the database changes only when you run the Apply Changes to DB... button.
  • Conversely, data edits applied on the Data tab run on the database right away, regardless of the save button.
  • For a table in the database, the DDL tab does not show your edits. Check the DDL that will run in the apply preview.
  • If you choose the Replace button after the Refresh button, all edits not applied to the database are lost.
  • Tables in a system schema are read-only. The Tables in system schemas are read-only. DDL changes are blocked. notice appears over the tab, and you cannot save or apply.
  • In a signed-in account project, when you are a member whose DDL execution is restricted, a table that another team member is editing becomes read-only with the This table is being modified by another team member and cannot be edited. notice.