4an70m / apex-query-builder

Convenient query builder for dynamic SOQL queries
MIT License
53 stars 25 forks source link

Add NOT conditional operator #17

Open TrangOul opened 3 months ago

TrangOul commented 3 months ago

I see not way to introduce NOT operator (not to be confused with NOT IN) in the WHERE part, otherwise than rewriting the query. Example:

WHERE NOT (Industry = 'Agriculture' OR Industry = 'Biotechnology')

cannot be built in this framework; we need to rewrite it as:

WHERE Industry != 'Agriculture' AND Industry != 'Biotechnology'
4an70m commented 3 months ago

Hi @TrangOul. Thank you for taking an interest in the repo! I've seen your comments but I cannot get back to them soon due to my workload. I'll try to make some time for this next month.

Regarding this type of condition: yes, the implemented Conditions are rather limited compared to what SOQL allows, so currently to implement this type of condition the best you can do is to use the SimpleConditon class and past the whole string.