On 11/28/06, George Hartzell <[EMAIL PROTECTED]> wrote: > It looks like I might be able to figure out how to get RDO::Manager to > express the query, but it would be quicker (at least as a first cut to > be able to do something like > > Foo::DB::Moose::Manager->get_iterator_from_sql(blahblahblah); > > I haven't seen anything in my dives into the docs. Is it possible? > Can you give me a pointer?
The get_objects_from_sql() Manager method will fetch objects based on hand-coded SQL: http://search.cpan.org/dist/Rose-DB-Object/lib/Rose/DB/Object/Manager.pm#get_objects_from_sql but it will return all the objects at once. Another Manager method, make_manager_method_from_sql(), will create a method based on your hand-coded SQL. This is a bit more like CDBI's set_sql method. http://search.cpan.org/dist/Rose-DB-Object/lib/Rose/DB/Object/Manager.pm#make_manager_method_from_sql But again, it returns all the objects at once. There's currently no iterator-based variant of those two methods. (Coming from CDBI, that shouldn't bother you too much, however, since the last time I checked, CDBI fetches all the rows from the database before allowing the first iteration anyway. The iterators used by the RDBO Manager, OTOH, fetch rows on demand, in response to each iteration.) All of that said, adding iterator options to get_objects_from_sql() and make_manager_method_from_sql() is pretty simple. If you really want it, I'll throw it in the next release :) -John ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ Rose-db-object mailing list Rose-db-object@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rose-db-object