[Catalyst] DBIC ResultSet - what columns in it?

Matt S Trout dbix-class at trout.me.uk
Thu Dec 20 01:25:41 GMT 2007


On Wed, Dec 19, 2007 at 03:09:01AM -0200, Silvio Almeida wrote:
> I was looking for a way to get column names from a ResultSet.
> 
> If I have a table with columns id, to, from, subject which is mapped 
> into Email then if I do
> 
> $c->model('Email')->{_source_handle}{schema}{source_registrations}{Reuniao}{_ordered_columns}

(1) that should be $c->model('NameOfDBICModel::Email')

(2) if you EVER do direct hash access on a DBIC object your code ceases to be
supported by the development team. full stop. If you're supposed to get at it,
there'll be an accessor. If there isn't and you need to, you should be discussing
on the DBIC list (which is where this question should have been asked in the
first place) why we should accept a patch to add such an accessor :)

(note, this is not an attack, just a warning - an attack would have included
the words "if you do this, expect to be fired" :)

-- 
      Matt S Trout       Need help with your Catalyst or DBIx::Class project?
   Technical Director                    http://www.shadowcat.co.uk/catalyst/
 Shadowcat Systems Ltd.  Want a managed development or deployment platform?
http://chainsawblues.vox.com/            http://www.shadowcat.co.uk/servers/



More information about the Catalyst mailing list