Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

Matts (1087)

Matts
  (email not shown publicly)

I work for MessageLabs [messagelabs.com] in Toronto, ON, Canada. I write spam filters, MTA software, high performance network software, string matching algorithms, and other cool stuff mostly in Perl and C.

Journal of Matts (1087)

Thursday January 30, 2003
06:40 AM

SQLite fetchrow

[ #10294 ]

At the moment in DBD::SQLite I have to use the API to get an entire select results into memory and then loop through that for fetch() calls. This is a bit annoying because it uses lots of memory for large result sets.

Internally SQLite implements a callback mechanism (sort of like SAX) but this doesn't work with the DBI's model of working, so we have to use the above.

Thankfully the SQLite team has added a non callback streaming API into CVS, so at some point I'll convert DBD::SQLite to use this.

Even more interesting is that the model looks almost exactly like how the DBI is written, so the code will get even simpler in the next release. Woot.

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • You wouldn't think maybe perhaps the SQLite developers hadn't noticed DBD::SQLite, and said "gee, we need to interface to that better?"
    --
    • Randal L. Schwartz
    • Stonehenge
    • I would expect either Matt told them what they needed to do, or else the SQLite developers naturally figured out on their own that there was a better way of doing things. If it works well for DBI, it'll work well for other software packages, too.

      --
      J. David works really hard, has a passion for writing good software, and knows many of the world's best Perl programmers
    • I don't actually have that much contact with them. However I think developers of other packages do - such as the Delphi and ODBC developers. I think pretty much every high level database access layer works like DBI, so the model they chose only maps well to custom apps.

      Good to see it developing so fast though. Maybe next we'll be able to store binary data (if only!).