opfo / app

An iOS app for the EDA397 course made at Chalmers in the spring of 2013.
7 stars 1 forks source link

Feature/opfquery #5

Closed jesjos closed 11 years ago

jesjos commented 11 years ago

Okay so here's something akin to a wrapper API for doing a little more advanced queries without having to write actual SQL.

I have yet to hook it up to the models, but it should be straight forward.

Example query:


[[[[OPFComment query] whereColumn: @"post_id" is: @"2"] whereColumn: @"text" like: @"%%CSS%%"] whereColumn: @"user_id" in: @[@"1", @"2", @"3"]]

This will produce the following SQL:

"SELECT 'comments'.* FROM 'comments' WHERE ('comments'.'post_id' = 2 AND ('comments'.'text' LIKE '%CSS%' AND 'comments'.'user_id' IN (1,2,3)))"