0

I have a RethinkDB database with a table that contains information that I need in my iOS app. I've been told that I can use JSON and POST requests to submit/download data from the database, but am not sure how to go about doing so. Here's what I have so far:

NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"http://%@:%i", hostName, portNumber]];
NSURLRequest *request = [NSURLRequest requestWithURL:url];
NSURLConnection *connection = [[NSURLConnection alloc] initWithRequest:request delegate:self];
[connection start];

Once the connection is opened, how do I go about querying the RethinkDB server? I want to be able to download a certain number of entries and use the built-in "limit" and sort functions. Thank you in advance.

Community
  • 1
  • 1
Kai Banks
  • 5
  • 3
  • your xcode doesn't "query" the db. it contacts a web service which does the querying on its behalf. – Marc B Jun 29 '15 at 18:06
  • @MarcB No, Xcode is an IDE. It doesn't query anything. The running app (that may have been written using Xcode) does the querying. – rmaddy Jun 29 '15 at 18:13
  • @rmaddy: true 'nuff. either way, you don't talk to the db directly, you talk to a webservice intermediary – Marc B Jun 29 '15 at 18:14
  • @KaiBanks You need to talk to the server folks and find out what API they provide. – rmaddy Jun 29 '15 at 18:14
  • @rmaddy, the API is provided by RethinkDB, which is essentially a noSQL database. I just need to figure out how to encapsulate Javascript/Python/Ruby or other query languages into my code - any ideas or helpful links? – Kai Banks Jun 30 '15 at 18:08

0 Answers0