DbSchema Layouts
Index
What is a Layout?
A layout is a database diagram with associated data and query tools. Think of it like a board on which you can make your own representation of the database schema. Inside the layout, you can edit tables and foreign keys by just double-clicking on them. Add tables, foreign keys, groups, callouts, and access data tools like Relational Data Explorer or SQL Editor. You can create as many layouts as you need, each focused on a specific part of the schema. A table can be present in multiple layouts.

Why we use Layouts?
- Layouts allow you to separate complex databases into more specific sections. Therefore you can gain a better understanding of the database;
- The layout offers a visual representation of the database;
- You can edit tables, columns, foreign keys, and more just by clicking on them;
- Every layout is saved into the model file so you can later reopen it.
- The other DbSchema tools are open in the layout and will be saved to project file together with the layout.
Symbols in Layouts
Inside a layout, everything is represented graphically. This will help you gain a better understanding of the database and browse the data easily.
1. Table

2. Foreign Keys
Foreign keys can also have different visual representations based on their cardinality and ordinality. These are consequences of the nature of columns and indexes.
- Cardinality represents the maximum number of times an entry from a table can relate to entries from another table.
- Ordinality represents the minimum number of times an entry from a table can relate to entries from another table.
Based on the referencing column, there are 4 states in which a foreign key can be. We will try to understand them better by looking at some examples:
- One to zero or many
In the child table, the referencing column is not mandatory, nor unique. In this case, the parent table (1) can refer to zero or many entries in the child table (2).
- One to one or many
In the child table, the referencing column is mandatory, but not unique. In this case, the column from the parent table can refer to one (mandatory) or many.
- One to one
In the child table, the referencing column is mandatory and unique. In this case, the column from the parent table can refer only to one entry from the child table.
- One to zero or one
In the child table, the referencing column is unique, but not mandatory. In this case, the column from the parent table can refer to one or zero entries from the child table.
Design Schema Online or Offline
Using DbSchema you can design the schema while connected to a database (online) or without database
connection (offline).
In the online mode, all table and column changes will be applied in the database. The executed statements are visible on the left, in the SQL History pane.
In the offline mode, changes will be applied only to the DbSchema model which will be saved to file. You need to connect to the database and choose one of the Schema options (Refresh/Compare with the database).

Add tables to layout
1. Add tables from the tree panel by drag & drop.

2. Add tables using the foreign key icon.

Auto place
DbSchema integrates an option that will instantly organize the schema for you.
To access it, right-click on the layout and choose the Auto place option.

Column Visibility & Position
DbSchema does not allow resizing tables. Instead, you can choose the visible columns. The reason for this is that we focus on large and very large diagrams, where this feature will conflict with our algorithms for optimal handling diagrams.- Change the column visibility by double-clicking the table header. Then choose whether you want to see it or not from the visible column.
- Change the column position by clicking on the Up or Down buttons.

Virtual Foreign Keys
There are databases that contains no foreign keys. In these situations, you may create virtual foreign keys. Virtual foreign keys will be created only in DbSchema and will be saved to the model file.

Foreign Key Routing
The foreign key line is routed automatically.
DbSchema is optimized for managing large diagrams, where this feature is likely to create problems.
You can choose between two modes of routing the foreign key lines: from table to table or from column to column.
In the second case, the line will point to the involved columns. Two foreign keys may merge into one line if they are pointing to the same column.


Show Data Type

Add Callouts
Add callouts by right-clicking on an empty part of the layout. Choose the Create a Callout option.

Fast Browse Table Data
Browse data from tables directly in the layout. Hold SHIFT + CTRL and click on the table header to see its contents.

Data Tools
You can open the data tool menu just by clicking on the table header.