I now need to combine them together according to a user-supplied “and/or” custom logic. One example custom logic could look like this (users can use “and”, “or”, as well as parentheses):
user_logic = "(1 and 2) or (3 and 4)"
Out of this, I would need to dynamically build the following:
...where: (^dynamic_1 and ^dynamic_2) or (^dynamic_3 and ^dynamic_4)
I think the second step is where my biggest problem is, even if I get the parsed output. How do I get something like a parsed “or” (for example) into a dynamic query?