Implicit AND clause on addConditions() with multiple conditions
Current behaviour:
new QueryBuilder(Account.class)
.addConditions()
.add(new QueryBuilder.SimpleCondition('Name = \'Test\'')
.add(new QueryBuilder.SimpleCondition('Field2 = \'Test\'')
.endConditions()
.toString();
// returns SELECT Id FROM Account WHERE Name = 'Test'
Expected behaviour:
SELECT Id FROM Account WHERE Name = 'Test' AND Field2 = 'Test'
If there is no explicit ordering set I think it should implicitly join all Conditions with an AND clause
I have it implemented -> should I send PR?
I think it makes sense to implicitly join Conditions with AND. Please, send a PR.
Hello. Have you implemented this solution ? Because I need really need it
Hi, this would be nice to have.
Hi,
I have forgotten to send the PR and in the meantime I have deleted that branch as we have moved & refactored to use: https://github.com/PropicSignifi/Query.apex
It solves this issue & the API is better suited for algorithmic query building.
:) Sorry.
Great!
Looks much better :+1:
thanks