Manage your schema
Inspect and edit indexes, constraints, functions, triggers, and access rules.
Pick Schema from the menu at the top of the Navigator, or press Cmd+2 (Ctrl+2), then choose an object type. Pick a row to inspect its definition and settings.
| Object | What you can inspect | Engines |
|---|---|---|
| Enums | Types and their allowed values. | PostgreSQL |
| Indexes | Indexed columns, uniqueness, and index type. | All |
| Constraints | Primary keys, foreign keys, unique keys, and checks. | All |
| Functions | Functions and procedures: arguments, return type, and body. | PostgreSQL, MySQL, MariaDB, SQL Server, Oracle |
| Triggers | Table, event, and trigger body or function. | All except ClickHouse |
| Policies | Row access rules. | PostgreSQL, SQL Server, ClickHouse |
| Privileges | Grants and who holds them. | MySQL, MariaDB |
Each page has a search field, a schema picker, and a filter by kind, such as constraint type or functions versus procedures. Click a column header to sort by it: numbers sort largest first, names A to Z, and a third click goes back to the original order.
Indexes
Indexes are grouped by table. A badge marks primary keys and unique indexes, and the index method shows next to the columns only when it isn't the engine's default, like gin on PostgreSQL. Partial indexes show their where condition, on PostgreSQL, SQL Server, and MongoDB, and PostgreSQL shows include columns too.
Redundant marks an index whose columns another index on the same table already starts with, such as an index on domain next to a primary key on domain, user_hash. Queries can use the other one, so this one usually only slows down writes. Point at the badge to see which index covers it.
On PostgreSQL, each index also shows its Size and how many times queries have read it (Scans). Unused marks a regular index no query has read since the database's statistics were last reset. While you sort by size or scans, the table with the largest index comes first.
For table relationships, open the visualizer.
Create, edit, or drop
Click Add index, Add enum, and so on above the list to create an object. On desktop, Cmd+N (Ctrl+N) does the same. The button is missing where the engine can't create that kind of object, like constraints on SQLite.
To edit an object, open it, change the enabled fields, and save.
To drop one, right-click its row and choose Drop, or press Cmd+D (Ctrl+D). Tamery asks first. On PostgreSQL, constraints, enums, and functions can be dropped with Cascade, which also removes whatever depends on them.
Some changes can only be made by replacing the object. The save button then says so, like Rebuild index, Replace enum, or Recreate constraint. Read its warning before saving: replacing can affect dependent objects or permissions.
A read-only field is one Tamery can't change safely from the form. Use the Query editor for those.
Triggers
On PostgreSQL, SQL Server, and Oracle, switch a trigger off and on without dropping it. Use Enable or Disable in its row menu, or the Enabled switch when it is open.
Row level security
On PostgreSQL, a policy only takes effect when row level security is on for its table. Right-click the table in the Navigator and choose Enable RLS or Disable RLS, or use the Row level security switch in the policy. Tables with RLS on show a shield in the Navigator.
On SQL Server, use the policy's Enabled switch and set its predicates in the inspector.
On ClickHouse, policies are row policies for SELECT.