Open jesjos opened 11 years ago
@makxan I added a task to use db-generated ids
@makxan I'm rewriting OPFUpdateQuery to use safe insert and also writing code to generate the id.
@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.
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 :/
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 useexecuteQuery: withParametersInArray
orexecuteQuery: withParameterDictionary
, fromFMDatabase
.Preferrably, model classes should construct their own update queries, rather than having this hardcoded into
OPFUpdateQuery
.Tasks
Important
Optional