[Dbix-class] Re: DBIx::Class Component for Snowflake Schemas

Matt Follett matt.follett at gmail.com
Wed Apr 1 21:31:28 BST 2009


All,

Sorry, I lied.  I found some things to change on it.  The link provided is
to an old version, this link:
http://tinyurl.com/cdlu4h
will point to the version that is most recent and if you want to look at all
the versions they are available here:
http://tinyurl.com/cspmbv

thanks,
Matt Follett

On Tue, Mar 31, 2009 at 10:55 AM, Matt Follett <matt.follett at gmail.com>wrot=
e:

> Hello all,
>
> I've been working with generating reports from Star/Snowflake schemas.  As
> such I've written a module that makes this a little easier, at least for
> me.  The module consists of a Dimension and a Fact component.
>
> Loading the Dimension component in a class provides two pieces of
> functionality, it allows you to assign columns of that table that should =
be
> ignored and it allows you to get a listing of all of the columns that are
> related to that dimension across any of the tables that are related to it.
> In a Star schema this will just return the columns you aren't ignoring and
> in a Snowflake schema this'll recursively walk through the tables to gath=
er
> all of the columns.  The data for that is returned as an array of hashes
> containing the column name and the column data type.
>
> The Fact component provides those two subroutines and a third called
> generate_report.  This subroutine takes a hash ref like so:
> {'filters' =3D> {'dimedate.day_of_week' =3D> 3}, 'metric' =3D>
> {'dimline.line_velocity' =3D> 1}}
> And would return the ResultSet after converting the line_velocity value to
> an appropriate value for that fact table and  would now include a column
> 'dimdate.day_of_week' with the values from whatever related dimension tab=
le
> that came from.
>
> The module allows you to to make a full round trip.  So, you could ask a
> fact table what attributes are available, provide those to another source,
> get back the attributes requested for filtering and viewing, and then pass
> those back to the fact through generate_report.
>
> You can download the module from here:
> http://tinyurl.com/c7gr3t
>
> Does anyone have some comments or recommendations on it?  I still need to
> fix up some of the documentation, it's there but it's not complete.  Once
> that is done do you think this would be worth putting on CPAN as
> DBIx::Class::Snowflake?
>
> Thanks for your time,
> Matt Follett
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/dbix-class/attachments/20090401/296=
1e77f/attachment.htm


More information about the DBIx-Class mailing list