RedQueryBuilder - recursive query

57 Views Asked by At

The issue is a self referencing schema such as employee has a supervisor that is an employee. This is tracked with a FK of supervisor_id in the employees table. The FKS is described below:

"fks": [
    {
      "referencedTableName": "employees",
      "name": "supervisor_id_fks",
      "label": "Supervisor",
      "foreignKeyNames": [
        "supervisor_id"
      ],
      "referencedKeyNames": [
        "id"
      ],
      "reverseLabel": "Subordinate"
    }

Once deployed, the FKS association and the reverse are available in the select options, however, these items are not selectable. Please let me know if there is something I am missing.

1

There are 1 best solutions below

2
salk31 On

I'm afraid it is a bug/missing feature.

There is code to unravel joins when you get back to the same join table.

Please could you raise a ticket: https://github.com/salk31/RedQueryBuilder/issues ?

Any more background to your use case would be helpful. e.g. Do you only ever want/need the user to go one level deep?