Record Page¶
In this section we summarized features of record page. The following are different sections are a record page:
Related Entities¶
The list of related entities comes from the visible-foreign-keys
annotation defined on the main table of the page. Each related entity can have two different display modes:
- Table View: The default presentation mode for related entities.
- Markdown View: If the related table has a
row_markdown_pattern
incompact/breif
context in itstable-display
annotation, this display mode will be activated. It will provide a summary of a page of related entity data to the users. Users can switch to the table mode by clicking on the “Edit” link on top right corner (If users lack edit access to this table, the link caption would be “Table Display”).
Add Related Entity¶
Users can add new related entities by click on the “Add” button on top right corner of a related entity. Chaise will behave differently based on the related entity type.
- If it’s a pure and binary association related entity, Chaise will open a modal picker that will allow users to select entities for the related table.
- Associative entities are entities in another table that establish many-to-many relationships between entities. To illustrate this, let’s assume table
A
has two foreign keys, one to tableB
and another toC
(B <- A -> C
). Then we can say thatC
andB
are in associative relationship and for a reference that encapsulatesB
, a reference that encapsulatesC
is a related reference. TableA
must have the following properties to be counted as pure and binary associative table:- Must have only two outbound foreign keys.
- Exception: foreign keys that are based on system columns are allowed.
- Must have a unique constraint key based on the columns of the two outbound foreign keys.
- Cannot have any other unique constraint keys.
- Exception: simple keys that are based on system columns or
serial
typed columns are allowed.
- Exception: simple keys that are based on system columns or
- Cannot have any extra column that is not part of any keys.
- Exception: system columns are allowed.
- Cannot have any inbound foreign keys.
- Must have only two outbound foreign keys.
- Associative entities are entities in another table that establish many-to-many relationships between entities. To illustrate this, let’s assume table
- Otherwise, Chaise will open a recordedit page in a new tab. In this page, some of the visible data are going to be pre-filled. Chaise will pre-fill any data that is defined by the one-to-one relationship between the parent and related table. This includes,
- The foreign key relationship that is defining the related table (let’s call this foreign key “original”).
- All the foreign keys that are superset of the original foreign key and their extra columns are not-null (let’s call these foreign keys “candidate”s). Superset means that it must include all the columns of original foreign key and the mapping must be exactly the same. For example if original foreign key is defined by T1(c1,c2) -> T2(v1,v2), the candidate foreign key must have at least c1 and c2 columns, and in its definition c1 must map to v1 and c2 must map to v2. It could also have any extra not-null columns.
- All the constituent columns of original and candidate foreign keys.