About this template
File location: | /_templates/integrations |
Used in: | |
Repo link: | Click to view in the Stitch Docs repo |
Instructions: |
This template is used to create foriegn key references in SaaS integration table schema documentation.
Template sections
Each template is grouped into sections to make parameters easier to find. These sections and the parameters they contain are described below.
Tap details
The integration’s name and version.
Parameter | Description |
tap STRING |
The name of the integration, corresponding to the value of |
version STRING |
The applicable version of the integration. Example values:
|
Foreign key details
The high-level details about the foreign key.
For every key you want to list, there must be an item in foreign-keys
containing the attributes listed in the section below:
foreign-keys:
- id: "customer-id"
attribute: "customerId"
table: "customers"
all-foreign-keys:
- table: "customers"
join-on: "id"
- table: "orders"
- table: "refunds"
- id: "order-id"
attribute: "orderId"
table: "orders"
all-foreign-keys:
- table: "orders"
join-on: "id"
- table: "refunds"
Parameter | Description |
id STRING |
The foreign key ID. This is the name of the column with dashes separating individual words. For example: Example values:
|
attribute STRING |
The name of the key, typically as the most common version of the key name. For example: If many tables have a |
table STRING |
If applicable, the name of the ‘parent’ table for the foreign key. For example: If the attribute were |
Foreign key list
This corresponds to the attributes found in the all-foreign-keys
list of foreign-keys
.
This list must exist for every item in foreign-keys
. At a minimum, every item in the all-foreign-keys
list must contain the table
attribute:
foreign-keys:
- id: "customer-id"
attribute: "customerId"
table: "customers"
all-foreign-keys:
- table: "customers"
join-on: "id"
- table: "orders"
- table: "refunds"
Parameter | Description |
table STRING |
The name of the table that contains the foreign key. |
subtable STRING |
If the key exists in a subtable, you can add an additional For example:
This would create a reference like this: |
join-on STRING |
The name of the attribute that can be used to join the tables together. Note: This is only required if the name of the attribute in the table is different than what’s in For example: In parent tables, the key is usually named
In this case, the |
Back to top
Last updated: 28 July 2021