Allow common reference macros to be defined in the data sync files #76

Closed
opened 2021-12-07 04:34:04 +00:00 by jamie · 4 comments
jamie commented 2021-12-07 04:34:04 +00:00 (Migrated from git.hazaar.io)

Currently, to add a referenced value to a row, the macro needs to be defined in EVERY row. This has worked well till now, but it can definitely be enhanced.

I would like to add a new data sync row object property called refs that defines a column name and the macro that should be applied to it automatically. That way, the macro can be executed once and the value used in all rows for this data sync object.

Such as:

[
    {
        "table": "test_type",
        "rows": [
            {
                "name": "test1",
                "label": "Test #1",
                "seq": 1,
                "enabled": true
            }
        ]
    },
    {
        "table": "test",
        "refs": {
            "test_type_id": "::test_type(id):name=test1"
        },
        "rows": [
            {
                "note": "Test Number 1",
                "date_completed": null,
                "completed": false
            },
            {
                "note": "Test Number 2",
                "date_completed": null,
                "completed": false
            },
            {
                "note": "Test Number 3",
                "date_completed": null,
                "completed": false
            }
        ]
    }
]
Currently, to add a referenced value to a row, the macro needs to be defined in EVERY row. This has worked well till now, but it can definitely be enhanced. I would like to add a new data sync row object property called `refs` that defines a column name and the macro that should be applied to it automatically. That way, the macro can be executed once and the value used in all rows for this data sync object. Such as: ```json [ { "table": "test_type", "rows": [ { "name": "test1", "label": "Test #1", "seq": 1, "enabled": true } ] }, { "table": "test", "refs": { "test_type_id": "::test_type(id):name=test1" }, "rows": [ { "note": "Test Number 1", "date_completed": null, "completed": false }, { "note": "Test Number 2", "date_completed": null, "completed": false }, { "note": "Test Number 3", "date_completed": null, "completed": false } ] } ] ```
jamie commented 2021-12-07 04:34:04 +00:00 (Migrated from git.hazaar.io)

assigned to @jamie

assigned to @jamie
jamie commented 2021-12-07 04:34:08 +00:00 (Migrated from git.hazaar.io)

created merge request !45 to address this issue

created merge request !45 to address this issue
jamie commented 2021-12-07 04:34:08 +00:00 (Migrated from git.hazaar.io)

mentioned in merge request !45

mentioned in merge request !45
jamie commented 2021-12-09 06:43:42 +00:00 (Migrated from git.hazaar.io)

mentioned in commit fe70c6ffda

mentioned in commit fe70c6ffda20e33a074480070b4b4906732507c2
jamie (Migrated from git.hazaar.io) closed this issue 2021-12-09 06:43:42 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: hazaar/hazaar-dbi#76
No description provided.