« What do you want in Inbox 3.1? | Main | Congratulations President Elect Obama »

SQLite and .Net

One part of Inbox that I detest is the back-end storage model it uses to keep track of posts and their states (read state, flag state, current folder).  It basically keeps this information in memory then serializes it out into XML files when you shutdown Outlook.  It wasn't my decision to write Inbox this way, but I have kept this code and added to it considerably over the years.

One reason I kept it is that I didn't want to deal with installing a database along with an Outlook add-in.  Seemed like overkill really.  But that was before I played around with SQLite.

SQLite along with System.Data.SQLite make it ridiculously easy to install a back end database with full SQL support.  How easy?  Include the System.Data.SQLite, then create a connection:

SQLiteConnection sqliteConn =
   new SQLiteConnection("Data Source=MyDb.db3;Pooling=true;FailIfMissing=false");

That's it.  Database created, ADO object ready, now just populate it.  I used SQLite Administrator to create my database schema, then just exported the SQL script to execute in my actual program.

So far so good.  Hopefully this works out.  Even though users won't *see* a difference they should notice an improvement in performance.  And my code will be drastically simpler which is always good... that is if everything works out and I can get everything ported!

Posted by Nick Harris on November 3, 2008 at 03:41 PM | Permalink

Comments

That is pretty cool. I remember looking at Firebird way back in the day for the same purpose.
If you recall, though, one reason Inbox went to XML files is that we tried using in-memory ADO recordsets, which would explode in both size and inefficiency with large subscription lists. Do you still see that problem?

Posted by: Gordon Weakliem | Nov 11, 2008 9:43:03 PM

@Gorden -

I couldn't remember why we switched away from ADO. I'll have to keep that in mind when I get back to Inbox - though it doesn't look like that's going to be anytime soon.

Posted by: Nick Harris | Nov 12, 2008 8:28:20 AM

The comments to this entry are closed.