Files
gristlabs_grist-core/app/common
Jarosław Sadziński 1d2cf3de49 (core) Adding backend for 2-way references
Summary:
Adding support for 2-way references in data engine.

- Columns have an `reverseCol` field, which says "this is a reverse of the given column, update me when that one changes".
- At the time of setting `reverseCol`, we ensure that it's symmetrical to make a 2-way reference.
- Elsewhere we just implement syncing in one direction:
  - When `reverseCol` is present, user code is generated with a type like `grist.ReferenceList("Tasks", reverse_of="Assignee")`
  - On updating a ref column, we use `prepare_new_values()` method to generate corresponding updates to any column that's a reverse of it.
  - The `prepare_new_values()` approach is extended to support this.
  - We don't add (or remove) any mappings between rows, and rely on existing mappings (in a ref column's `_relation`) to create reverse updates.

NOTE This is polished version of https://phab.getgrist.com/D4307 with tests and 3 bug fixes
- Column transformation didn't work when transforming RefList to Ref, the reverse column became out of sync
- Tables with reverse columns couldn't be removed
- Setting json arrays to RefList didn't work if arrays contained other things besides ints
Those fixes are covered by new tests.

Test Plan: New tests

Reviewers: georgegevoian, paulfitz, dsagal

Reviewed By: georgegevoian, paulfitz

Subscribers: dsagal

Differential Revision: https://phab.getgrist.com/D4322
2024-09-11 22:31:36 +02:00
..
2024-08-23 11:24:35 -04:00
2022-02-19 09:46:49 +00:00
2021-09-16 10:06:04 -04:00
2020-07-21 20:39:10 -04:00
2020-07-21 20:39:10 -04:00
2022-02-19 09:46:49 +00:00
2024-05-22 14:56:53 +02:00
2020-07-21 20:39:10 -04:00
2022-05-09 21:44:57 +02:00
2020-07-21 20:39:10 -04:00
2024-05-19 09:09:19 +02:00
2024-02-22 08:44:25 -05:00
2020-07-21 20:39:10 -04:00
2024-03-21 13:01:25 -04:00
2022-08-25 12:38:36 -07:00
2020-07-21 20:39:10 -04:00
2020-07-21 20:39:10 -04:00
2022-02-19 09:46:49 +00:00
2024-08-14 16:48:36 -04:00
2023-01-16 16:50:42 -08:00
2020-07-21 20:39:10 -04:00
2024-05-22 14:56:53 +02:00
2023-08-29 09:19:52 +02:00
2022-03-12 14:34:46 -08:00
2020-07-21 20:39:10 -04:00
2024-08-23 11:24:35 -04:00
2020-07-21 20:39:10 -04:00
2020-09-29 18:57:56 -04:00
2024-07-23 11:49:23 -04:00
2021-07-20 15:17:03 +02:00
2023-03-16 17:37:24 -04:00
2024-01-19 10:34:03 +01:00