Confused on Prisma's where clause: OR and AND
I'm trying to write a query that queries the repositories that aren't
SELECT * FROM Repository r
WHERE r.hidden = false
OR (r.hidden = true AND r.userId = ctx.session.user.id)
which is very simple, but for some reason, I can't get this to work on my procedure at all:
hidden for everyone, but for the logged user, it also queries the hidden ones. I think the SQL for that would be something like:SELECT * FROM Repository r
WHERE r.hidden = false
OR (r.hidden = true AND r.userId = ctx.session.user.id)
which is very simple, but for some reason, I can't get this to work on my procedure at all:
