in reply to Class::DBI::* module proposal

Have you looked at the helpers for doing this in the latest release of Class::DBI? Check the "Single Value SELECTs" section.

Replies are listed 'Best First'.
Re: Re: Class::DBI::* module proposal
by dcvr69 (Beadle) on May 20, 2004 at 00:51 UTC

    Yes. Single Value selects are useful, but don't allow for parametric queries like AbstractSearch.

    I was hoping there was already a builtin way to allow for COUNT(*) ... WHERE, but I couldn't see a way to do it natively, and a generic fashion for my whole class tree.

    The ability to do other aggregates was just an afterthought when I started considering posting to CPAN.

    If I've missed something in the base CDBI class, please, enlighten me. (I've already promised to peruse the rest of the CDBI namespace for something that does this - though I'm pretty sure I looked before embarking on this).

    Update: Re: single value selects: I'd have to build the SQL myself for each variation of the where clause - which is where AbstractSearch came in, and the idea of a mixin/plugin to add things like count_where, min_where, etc, to my base class. I'm most definitely not trying to reinvent the wheel.