Hello all, I'm creating an optional clause with multiple variables, and I noticed that it only executes the block if all variables are filled
for example in this query:
select id, name
from table
where deleted_at is null
[[
and table_id in (
select id
from public_table
where 1= 1
and name in ({{var1}})
or type_id in (
select id
from table2
where name in ({{var2}})
)
or category_id in (
select id
from table3
where name in ({{var3}})
)
)
]]
In this example, if var1, var2, and var3 are filled, the optional clause will execute. However, I want only one statement like "and name = {{var1}}" to execute if I pass var1 and a similar case for var2 and var3
Is there any solution for this issue? Thanks