Wednesday, November 15, 2006

SQLite3ProfessionalPlugin and DoD

I extensively use Data-On-Demand ListBox in SQLiteManager and I soon realized that it works perfectly with cached data but not so well with the VirtualMachine or with the sequential RecordSet returned by the new SQLite3ProfessionalPlugin.
One solution could be to use the InstantQuery method build-into the plugin but there are times where this method cannot be used (for example with a count(*) sql where rowid isn't available).

In order to workaround to this issue I created the SQLite3RecordSet class that basically just cache in an in-memory database all the data returned by your sequential query. While I was writing this class I realized that I can do a bit more that just rewrite all the methods of a standard RecordSet, so for example I added the useful MoveTo method.

This solution isn't as fast as an InstantQuery but it works very well with controls like Data-On-Demand or with Einhugur DataGrid.
Here it is a test project.

0 Comments:

Post a Comment

<< Home