Re: [RDBO] Rose::DB::Object thingy like class::dbi's set_sql?

2006-11-28 Thread George Hartzell
John Siracusa writes:
 > [...]
 > 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 :)

It'd help a bunch.  I may take a stab at it, but if you get it going,
I'd love to try it.

I'm running 0.756 of Rose::DB::Object, because that's what's currently
in ports.  I could update the port to run current and/or poke the port
maintainer for an update (I think that the ports tree may be
frozen/slushy whilst they get the 6.2 release out the door).

Thanks!

g.

-
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


Re: [RDBO] Rose::DB::Object thingy like class::dbi's set_sql?

2006-11-28 Thread Michael Reece

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 :)


yes, please!

On Nov 28, 2006, at 1:33 PM, John Siracusa wrote:


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


---
michael reece :: software engineer :: [EMAIL PROTECTED]


-
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


Re: [RDBO] Rose::DB::Object thingy like class::dbi's set_sql?

2006-11-28 Thread John Siracusa
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


Re: [RDBO] Rose::DB::Object thingy like class::dbi's set_sql?

2006-11-28 Thread George Hartzell
George Hartzell writes:
 > 
 > Hi All [and John],
 > 
 > [...]
 > 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?

It turns out that I'm blind as a bat.

Looks like get_objects_from_sql will do exactly what I want.

Sorry for the wasted bandwidth

g.

-
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


[RDBO] Rose::DB::Object thingy like class::dbi's set_sql?

2006-11-28 Thread George Hartzell

Hi All [and John],

I'm exploring Rose::DB::Object et al..  I'm familiar with Class::DBI
and have messed around a bit (and decided not to adopt) with
DBIX::Class.

I'm working with a fairly large database that contains data handed to
me as XML with minimal documentation.

I've reverse engineered a schema that represents it, and built various
tools to dig useful information out of it.

One of the things that I want to do is best (for me, anyway...)
expressed as a big ugly query that digs out just the things that I
want.

In the Class::DBI world, I've done:

 Foo::DB::Moose->set_sql(poodle => qq{
   select moose.id
   from 
   ...
 });

 $meese = Foo::DB::Moose->search_poodle();

 while($moose = $meese->next()) {
   # blah, blah, blah
 }

I took this approach in part because I couldn't get Class::DBI to
express the query [hardly its fault, it's icky], and also because it
was just easier for me to understand.

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?

Thanks,

g.


-
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