forcedotcom/SalesforceMobileSDK-iOS — pull request #40 by jhersh (2012-03-21 23:52:00+00:00)
Title: SFQueryBuilder utility class for creating SOQL/SOSL queries

I added a new utility class, `SFQueryBuilder`, to make it super brain-dead easy to create SOQL and SOSL queries. Why? Because proper developers have better things to do than mess around wondering whether it's braces or quotes that denotes the search term in a SOSL query (it's braces).

`SFQueryBuilder` also handles escaping reserved characters out of SOSL searches.

Creating a SOQL query:

```
NSString *soqlQuery = [SFQueryBuilder SOQLQueryWithFields:[NSArray arrayWithObjects:@"Id", @"Name", @"Company", @"Status", nil]
sObject:@"Lead"
where:nil
limit:10];
```

Creating a SOSL query:

```
NSString *soslQuery = [SFQueryBuilder SOSLSearchWithSearchTerm:@"hersh"
fieldScope:nil // searches only name fields
objectScope:[NSDictionary dictionaryWithObject:@"WHERE isactive=true and "
"( usertype = 'Standard' or usertype = 'CSNOnly' ) ORDER BY lastname asc limit 5"
forKey:@"User"]];
```