I have a text component where users can enter order ids separated by commas:
e.g.
125,126,129
Then in a query, I want to make a where clause where I use it in clause "IN".
I've tried this:
WHERE
(true = {{ order_ids.value == "" }} OR orders.id IN ({{ order_ids.value.split(',').map(i => parseInt(i)) }}))
I was assuming I need to convert it to an array first and then convert each one to the integer.
But this doesn't work. The orders.id is an integer in DB.
The error I'm getting:
invalid input syntax for integer: "{NULL}"