Re: Fetch-on-demand iterators (was Re: [CDBI] Make CDBI go fast)

"Aaron Trevena" <[email protected]>
Newsgroups gmane.comp.lang.perl.modules.class-dbi
Message-ID <[email protected]>
Hi Schwern,

> The important change is that CDBI hands the iterator the statement handle and not a > list.  That's about all I need.  Unfortunately it will probably break people's existing
> custom iterators.  I haven't gotten a clear answer back from Tony on if that's allowed,
> but the Iterator interface is pretty undocumented.  Does anyone write custom iterators
> and if so how custom are they?  I can preserve most well-behaved subclasses.

I have a wrapper iterator that mostly uses the API, unfortunately it's
very naughty and peeks into the data structure to allow you to filter,
this would of course break if there wasn't any data in the result set
to peek at.

I'd like to be able to keep it working as it's rather cool IMHO - I'm
using it to append the results of a query for each leg of a journey
into a single iterator with the same API as the cdbi one, it also
allows me to skip duplicates, and even apply rules to filter results
out.

A.

-- 
http://www.aarontrevena.co.uk
LAMP System Integration, Development and Hosting
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.