Relationships
Relationships connect rows in one table to rows in another. SchemaStack discovers relationships from your database schema and lets you add them as columns to your views.
Discovering Relationships
To add a relationship column:
- Open the Properties Panel (right sidebar)
- Click Add Relationship Column
- Browse the discovery tree — it shows all tables related to your current workspace, organized by foreign key paths
- Select the relationship you want to add
- Configure the edit mode and display settings (see below)
- The relationship column appears in your view
The discovery tree follows foreign keys in your database, so only valid relationships are shown.
Relationship Edit Modes
Each relationship column uses one of three edit modes that control how related records are created and managed:
| Mode | Behavior | Use Case |
|---|---|---|
| Reference | Link to an existing row in the related table | Order → Customer (customer already exists) |
| Owned | Create and manage the related row inline | Order → Shipping Address (belongs to order) |
| Association | Many-to-many link through a join table | Student ↔ Course (enrolled in multiple) |
Reference Mode
Reference mode links to existing rows. When editing a reference cell, you get a searchable dropdown of rows from the related table.
- The related row must already exist — you cannot create new rows from the reference field
- Clearing the reference removes the link but does not delete the related row
Owned Mode
Owned mode lets you create and edit the related row directly within the parent row's form. The related row's lifecycle is tied to the parent.
- Adding a parent row can simultaneously create the owned row
- Deleting the parent row may cascade to the owned row (depending on your database constraints)
- Edit the owned row's fields inline without leaving the parent form
Association Mode
Association mode handles many-to-many relationships through an intermediate join table.
- Select multiple related rows from a searchable list
- Add or remove associations without affecting the related rows themselves
- The join table is managed automatically
Configuring Relationship Columns
After adding a relationship column, configure how it displays and behaves:
- Display Field — Which field from the related table is shown in the cell (e.g., a customer's name instead of their ID)
- Search Fields — Which fields are searched when filtering the dropdown (e.g., search by name and email)
- Inline Edit Fields — In owned mode, which fields of the related row are editable inline
These settings are configured per-column in the Properties Panel.
Further Reading
- Expanding Relationships (API) — How to query relationship data via the REST API