Hi all, I have a database containing number of different entities for which I want to basically do the same thing: make pretty pictures.
I am making a pipeline that more or less goes like this: Result set -> pivot table -> bar charts/time series/etc. It makes sense to me to consolidate the pivot function into a single ResultSet superclass so I can use it among various entity-specific ResultSets. A pivot, of course, is (at least the definition I care about) when an aggregate is grouped by two columns, the unique values in the second of which become the second through last columns to form a 2-dimensional matrix, whose cells are populated by the aggregate. I then plan take the output of this function and pass it directly into some kind of formatter (e.g. CSV, JSON, whatever) and then into something which can render a chart. Some questions: 1) Is there already a ResultSet superclass (or reasonable facsimile) that does this pivot (that apparently eludes my search-fu)? 2) If not, is this a totally insane strategy? 3) If not, would it make sense to generalize this functionality? And a bonus question: 4) Does it make sense to fake up a ResultSet to keep with the interface, or produce a different structure (e.g. Data::Table, which already has a pivot method)? Thanks, -- Dorian Taylor http://doriantaylor.com/ _______________________________________________ List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class IRC: irc.perl.org#dbix-class SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/ Searchable Archive: http://www.grokbase.com/group/[email protected]
