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_id is assigned to the rowid from the Note table (don’t like that but it works)
  • In the Note database is the title of the note stored. And in the summary column is the content of the note store if it isn’t too big (absolutely don’t understand why?!?!)
  • the data column from the note_bodies database contains the content of the note always. But in a really strange pseudo HTML format. Every line is in a div element and sometimes it has a br element at the end of the line. The problem is that these div tags 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!

No Comments »

V1ru8 on March 21st 2008 in iPhone