loobydooby
loobydooby
PPrisma
Created by loobydooby on 11/1/2024 in #help-and-questions
Filter relationship by value in parent
My brain broke. I just added a relationship between the 2 and it fixed it
6 replies
PPrisma
Created by loobydooby on 11/1/2024 in #help-and-questions
Filter relationship by value in parent
I want to be able to do this through the SDK if possible.
SELECT t.someId, o.otherColumn
FROM MyTable t
INNER JOIN MyOtherTable o ON t.someId = o.someId
WHERE t.myKey = true;
SELECT t.someId, o.otherColumn
FROM MyTable t
INNER JOIN MyOtherTable o ON t.someId = o.someId
WHERE t.myKey = true;
6 replies
PPrisma
Created by loobydooby on 11/1/2024 in #help-and-questions
Filter relationship by value in parent
I was hoping there would be a solution like:
...
someRelatedModel: {
where: { someId: '$.someId' }
}
...
...
someRelatedModel: {
where: { someId: '$.someId' }
}
...
6 replies
PPrisma
Created by loobydooby on 11/1/2024 in #help-and-questions
Filter relationship by value in parent
I don't have the list of someId at this point. I can query to get the list of all of those, then do another query to get the related models, but I was just hoping I could somehow filter that someRelatedModel in this query. I guess I could just write the raw SQL to do it if the SDK doesn't support it.
6 replies