[Dbix-class] Adding a column to a result set

James R. Leu jleu at mindspring.com
Mon Jun 25 20:19:52 GMT 2007


I'm using DBIx::Class with Catalyst.  I have implemented a Model that
acts as an aggregator for multiple Models based on the same
DBIx::Class::Schema.  Each query to the Model is executed on all
of the children Models, and a new resultset that represents the data
from all of them is returned.  I would like to add a new column to that
resultset indicating which child Model, that row cam from.

Is there an easy way to add new column to each row of a resultset for
which I assign the data?

I was thinking of using Class::Accessor to just add another mutator to each
DBIx::Class, and then set the data as it passes through my Model,
but this seems 'hackish' ... not like my approach so far isn't but this
seems even more so, plus it's crossing the lines of adding 'Model' logic
to the DBIx::Class.

-- 
James R. Leu
jleu at mindspring.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.scsys.co.uk/pipermail/dbix-class/attachments/20070625/b57e85e3/attachment.pgp


More information about the Dbix-class mailing list