Skip to content

Create and change tables

The structure editor keeps table definitions in a draft while you change columns, keys, indexes and constraints. You review the generated SQL before applying that draft.

  1. Open the plus menu at the bottom of the Tables sidebar.
  2. Choose New Table….
  3. Enter the table name and choose its schema, if shown.
  4. Use Add Column to define the columns you need.
  5. Set each column’s type, nullability and default.

A new draft starts with an id primary key column suited to the connected database. Review that column along with the ones you add.

To change an existing table, right-click it in the sidebar and choose Open Table Structure. You can also open its structure through Admin › Schema.

Table structure draft with columns, a staged addition and SQL review controls

Use Add Foreign Key to select a local column and its referenced table and column. Use Add Index to choose the indexed columns and their order. The constraint menu offers CHECK Constraint and UNIQUE Constraint where the database supports them.

For existing definitions, edit the corresponding row in the structure editor. Changing a key, index or constraint can generate a drop-and-create sequence, so inspect the complete SQL preview.

  1. Open the Problems badge if it reports issues.
  2. Correct errors in the draft.
  3. Click Preview SQL Changes.
  4. Check all statements and any destructive-change or transaction warnings.
  5. Click Apply.
  6. Review and complete the confirmation or password prompt.

Schema changes made through app controls always require at least confirmation. The connection’s stronger query protection still applies.

If a change fails, read the database error and any statement progress before continuing. Some databases commit schema statements separately; check the refreshed structure before making the remaining edits.

Open an existing object from the sidebar to inspect or edit its definition. The sidebar’s plus menu also offers creation actions for the connected database’s code objects. Choose an action, edit the starter SQL and review it before creation.

Use the SQL editor when you want to write schema statements directly. For table truncation, removal and maintenance, see storage and maintenance.

Use Discard to clear a draft. An existing table’s draft remains available after you close its structure tab, until you apply it, discard it or close the connection. Keep a new table tab open until you finish its draft.