Building complex queries

Sep 8, 2010 at 10:30 AM

Consider the example: the application displays a list of folders; when a user selects a folder, the application downloads a list of files stored in that folder and presents it to the user. Downloading the list of files can be implemented in the following way:


NSString *queryString = @"Folders('FOLDER_ID')/Documents";
QueryOperationResponse *response = [self.dataSource execute:queryString];

In my application, there are many cases similar to this, and I have to write a query builder that builds query strings like "Folders('FOLDER_ID')/Documents".

There is also another way to query the list of files:

DataServiceQuery *query = [self.dataSource folders];
[query filter: @"Id eq 'FOLDER_ID'", self.savedDocumentsFolderId];
[query expand:@"Documents"];
QueryOperationResponse *response = [query execute];

But developers who work with the service say that it results in additional INNER JOIN in their SQL queries, and it may affect performance.

It would be nice to have a feature that is capable of building complex queries such as "Folders('FOLDER_ID')/Documents" or "FolderDocumentItems('FOLDER_ID;DOCUMENT_ID')".




Mar 12, 2011 at 1:39 AM

This is fixed in Version 1.2. Complex queries of the form "Folders('FOLDER_ID')/Documents" work now.