Tabellum Manual

Tabellum for mobile · 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 tap Apply, and then you see every statement first. A design is a file in designs/.

7.1 Starting a design#

Open the menu and tap + next to DESIGNS.

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 on the canvas12345
  1. The connection Apply runs on
  2. Add a table, view, function…
  3. Reload the design from the database
  4. Apply the changes
  5. Add an object
A design on the canvas

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.

A tap on a table opens its inspector in a sheet from the bottom: name, comment, columns with their types and defaults, keys, foreign keys, checks and indexes, and the SQL for that object. Drag the sheet down to close it; its expand button opens the object full-screen.

The inspector of the selected table
The inspector of the selected table

7.3 Reviewing and applying#

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

Tap 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#

The expand button in the inspector opens an object in its own tab, with its definition and a preview: sample rows, the query plan, or the SQL that would run.

A table full-screen12
  1. Back to the canvas
  2. The form, or its preview
A table full-screen
An enum type and its values
An enum type and its values

Canvas 1 goes back to the design. Definition and Preview 2 switch between the form and 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.