[Melbourne-pm] Any DBIx::Class gurus around?

Brad Bowman list at bereft.net
Wed Sep 29 20:12:51 PDT 2010


Toby Wintermute wrote:
> On 29 September 2010 09:41, Jacinta Richardson
> <jarich at perltraining.com.au> wrote:
>> Toby Wintermute wrote:
> [snip code]
>>> DBIx::Class works really well for dealing with bunches of rows as if
>>> they were objects, but not as well when it comes to reporting queries.
>> That's exactly what I expected and what this example is intended to show.  :)
>> (In fact, this example is derived from a similar example I used for Class::DBI
>> where there was _no_ way to create such a query via the object interface so you
>> farmed it out towards DBI.)
> 
> May I solicit recommendations for Perl DB modules which *are* designed
> with creating reporting queries?

DBIx::SQLCrosstab does cross-tabs

http://search.cpan.org/~gmax/DBIx-SQLCrosstab-1.17/SQLCrosstab.pm

> A theoretical interface might be:
> my $reporter = DB::Report->new(schema => My::App::Schema->connect);
> my $result = $reporter->frequency_analysis(
>   where => { staff_id > 1000 },
>   join => { 'Staff' => 'projects' }
>   over => 'projects.projectname',
> );
> 
> And then I'd get back a frequency analysis of non-executive staff on projects.
> 


More information about the Melbourne-pm mailing list