DBIx::Class::Snowflake::Fact
version 0.10
DBIx::Class::Snowflake::Fact - Load this for any fact tables.
DBIx::Class::Fact - Make your table a star/snowflake fact table
__PACKAGE__->load_components(qw/ Snowflakee::Fact /);
Component for DBIx::Class that makes it easier to develop star or snowflake schemas. This will provide the class with useful accessors to get a list of dimensions and easily search given a dimension.
Returns the attributes of the fact excluding any ignore columns. It returns them as an array containing hashes each containing the data type and the accesssor name.
Convenience alias to attributes
generate_report returns a resultset for the report requested. Each item in the array is a row in the report and each element in the hash is one of the metrics requested.
Usage: $fact->generate_report({'filters' => {'dimdate.day_of_week' => 3}, 'metric' => {'dimline.line_velocity' => 1}})
The resolve types subroutine attempts to determine if the value passed in is the name of a dimension or an attribute given the columns of the current table.
In this case the term attribute is described as column on a fact table that does not reference another table. So, if there was a fact table fact_produced that had two columns, date_id and widget_id, and date referred to the date_id column of the date table which had a column dow and widget_id did not refer to anything then the following call: $fact->_resolve_types({'dow' => 3, 'widget_id' => 6}); the following hash would be returned: { 'attributes' => { 'widget_id' => 6}, 'dimensions' => { 'dow' => 3 }}
NOTE If the column does not exist it assumes it is a dimension, IT DOES NOT SEARCH FOR IT TO VERIFY.
To install DBIx::Class::Snowflake, copy and paste the appropriate command in to your terminal.
cpanm
cpanm DBIx::Class::Snowflake
CPAN shell
perl -MCPAN -e shell install DBIx::Class::Snowflake
For more information on module installation, please visit the detailed CPAN module installation guide.