dashjoin / platform

Dashjoin Is an Open Source & Cloud Native Low Code Development and Integration Platform that helps teams deliver applications faster 🚀 Uses a data-driven approach inspired by Linked Data to make use of your existing assets
https://dashjoin.com
GNU Affero General Public License v3.0
89 stars 7 forks source link

Links in tables not resolved correctly (PreRelease 5.1.30) #377

Closed pgrill79 closed 1 week ago

pgrill79 commented 2 weeks ago

Links in table were not resolved correctly in PreRelease 5.130

On the left side you see the source running with 5.1.25 on the right side with 5.1.30:

image

Also the link itself look strange and does not work:

http://localhost:19030/#/q_animal_getDescendents/46/0_0

aeberhart commented 1 week ago

Can you provide the "descendants" widget config? Is it JSONata or a query?

pgrill79 commented 1 week ago

It is a query: image

Maybe as notice: it has two FK, which points to the same table - maybe this causes issues ? (It worked in the release 5.1.25)

This is the query behind: SELECT "a1"."animalnr" as "Animal Nr", COALESCE("a1"."origin",'') || "a1"."eartag" as "Ear tag", "a1"."id" as "Name", "sex"."name" as "Sex", "a1"."color" as "Color", "a1"."birth" as "Date of birth", CASE WHEN "a1"."deceased" THEN 'Yes' ELSE 'No' END as "Deceased", a2.id AS "Other parent" FROM relationsrecursive r1 INNER JOIN animal a1 ON root = a1.id INNER JOIN relationsrecursive r2 ON r1.root= r2.root INNER JOIN animal a2 ON r2.id = a2.id LEFT JOIN sex on a1.fk_sex=sex.id WHERE r1.id = ${animalId} AND length(r1.relativerelation) = 1 AND length(r2.relativerelation) = 1 AND r1.relativerelation != r2.relativerelation

aeberhart commented 1 week ago

this was a side effect of supporting tables like

CREATE TABLE something (
  column1, 
  column2, 
  column3, 
  PRIMARY KEY (column1, column2)
)

where the first PK column links to /db/table/key1_key2

the condition was applied too broadly such that it broke in case of this query. Now, it is only applied to the table widget (select * from table) on the table page