opfo / app

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

Clean up OPFUpdateQuery #40

Open jesjos opened 11 years ago

jesjos commented 11 years ago

Issues:

Test code is still in master and there are no specs.

Also, objects are serialized by hand instead of using the MTL-serialization that we actually get for free.

Also, we are generating our own ID, which should be done by the database. Additionally: we're doing multiple queries to check that we didn't select an existing ID.

Also, we're building the query using NSString stringWithFormat, which isn't correct. We should use executeQuery: withParametersInArray or executeQuery: withParameterDictionary, from FMDatabase.

Preferrably, model classes should construct their own update queries, rather than having this hardcoded into OPFUpdateQuery.

Tasks

Important

jesjos commented 11 years ago

@makxan I added a task to use db-generated ids

jesjos commented 11 years ago

@makxan I'm rewriting OPFUpdateQuery to use safe insert and also writing code to generate the id.

makxan commented 11 years ago

@jesjos Cool :+1: I guess you haven't pushed it to master yet, but I will clean up OPFUpdateQuery later, because just now it looks terrible and has many inconsistencies. The reason for the messiness is some debugging I did yesterday.

jesjos commented 11 years ago

I just pushed fixes for safe insertion and id-generation. As we said earlier, the db isn't configured correctly, so we have to do a separate query to find the next id :/