The iPhone Notes DB - Terrible
Since I’m developing the iPhoneNotes application i worked alot with the iPhone Notes database. This database is the data-source for my app. But it has a terrible layout:
CREATE TABLE Note (creation_date INTEGER, title TEXT, summary TEXT)
CREATE TABLE note_bodies (note_id INTEGER, data, UNIQUE(note_id))
- column
note_idis assigned to the rowid from theNotetable (don’t like that but it works) - In the Note database is the
titleof the note stored. And in thesummarycolumn is the content of the note store if it isn’t too big (absolutely don’t understand why?!?!) - the
datacolumn from thenote_bodiesdatabase contains the content of the note always. But in a really strange pseudo HTML format. Every line is in adivelement and sometimes it has abrelement at the end of the line. The problem is that thesedivtags are not every time closed correct. So it is impossible to parse it with an XML parser.(I hate things like that) - Because the content of the note is stored twice it has a terrible data redundancy! I don’t understand why that is needed.
So Apple please update the notes application in version 2.0. The actual note’s db is not how things should be done!
V1ru8 on March 21st 2008 in iPhone