Tabellum Manual

Tabellum for desktop · Chapter 7

The schema designer

The designer is a canvas for changing a schema the way you would draw it: add tables, drag foreign keys between columns, edit types and constraints. Nothing touches the database until you click Apply, and then you see every statement first. A design is a file in designs/.

7.1 Starting a design#

Click + next to DESIGNS in the sidebar.

A new design12
  1. Where the design starts from
  2. Create a new database instead
A new design

Under Start from 1, choose:

Create a new database 2 makes the design create its database first; you choose its name, the server it is created on and its options.

7.2 The canvas#

A design: the canvas, and the inspector for the selected table12345
  1. The connection Apply runs on
  2. Add a table, view, function…
  3. Reload the design from the database
  4. Apply the changes
  5. The selected object
A design: the canvas, and the inspector for the selected table

Tables marked new or changed differ from the database; a red dashed table is one the database has and the design does not, which Apply would drop.

7.3 Reviewing and applying#

The Changes drawer under the canvas is always up to date: how many statements Apply would run, what it would drop, any warnings, and the statements themselves.

The Changes drawer, open
The Changes drawer, open

Click Apply 4 in the canvas picture. The statements open in the approval dialog and run in one transaction where the database allows it.

Applying a design
Applying a design

The code button next to Apply opens the same script in a query tab instead, to run it yourself or keep it.

7.4 When the database has changed#

If someone changed the database after you made the design — a migration, a new table — Apply would undo their change. Two buttons bring the design up to date:

7.5 Full-screen editors#

Double-click an object (or use the arrow button in the inspector) to open it in its own tab. On the left is its definition, on the right a preview: sample rows, the query plan, or the SQL that would run.

A table full-screen: definition and preview12
  1. Back to the canvas
  2. Preview rows, plan or SQL
A table full-screen: definition and preview
A view
A view
An enum type and its values
An enum type and its values

Canvas 1 goes back to the design. Rows, Plan and SQL 2 switch the preview.

7.6 Creating a database#

A design that creates its database
A design that creates its database

On PostgreSQL you choose the owner, template, encoding and collation; on MySQL the character set and collation; on SQL Server the owner and collation. Without a server, the new database is an SQLite file in the workspace.