Any reason why I can’t use dynamic values in custom SQL queries?
The first pic is an invalid query, while the second works fine.
Any reason why I can’t use dynamic values in custom SQL queries?
The first pic is an invalid query, while the second works fine.
I can get it to work when not using json directlly. There’s an issue with how this handles data I think. If I use a single string, I’m fine, whereas when I list several results it doesn’t work. If I paste this code output in the SQLL query, it works.
I suspect we’re not parameterizing array values into sql correctly… @icaro_guerra
@icaro_guerra helped me out and AFAIK this has been fixed. it’s working now!
SELECT *
FROM x
WHERE id = ANY( {{ ARRAY_VALUE }}::uuid[] )
Is working for me
Oops, forgot to mention it here too.
P.S someone give Icaro a raise
well that’s great
Hi! I run into this question and the solution with inserting an array worked for me.
Still, I’m curious if the team thinks it may be helpful to have a built-in “IN” clause for records filtering. I’m not sure why it is not there, maybe it’s not that easy?
There were a couple cases when I wanted to query smth like WHERE email IN (email1@smth.com, email2@smth.com)
or the same with other fields like an id.