Multiple variables in a optional clause

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

I believe you have to separate the variables e.g [[and var 1]] [[and var 2]]

Thank you for the suggestion!
It seems that Metabase doesn't have something called a placeholder for an empty variable, meaning I can use the placeholder when the variable has not been passed

My purpose is that if only var3 was passed, var1 and var2 will be like ... name in (''). Hence, the optional clause would be executed