[CDBI] How do you get the raw db value of a column rather than inflated object

Matt S Trout dbix-class at trout.me.uk
Sat Feb 11 15:23:51 GMT 2006


On Sat, Feb 11, 2006 at 06:57:32AM -0600, Peter Speltz wrote:
> I want the value in my has_a column and not the object.  How do i do this.
> 
> I'm using 3.14. I thought I used to use the low level "_attrs" method
> and recall it working but in 3.14 it does not work. I thought it was a
> bug and filed a report and Tony says it is the intended behavior.

has_a inflates via a trigger so the original value isn't kept anywhere; you
could try adding another trigger before you declare the has_a that stashes
it.

(I've never understood why CDBI does this - in DBIC you can simply call
->get_column("name") to get the uninflated value. DBIx::Class::InflateColumn
may or may not give you some ideas as to how to do an alternative CDBI
relationship, which is another possible approach)

-- 
     Matt S Trout       Offering custom development, consultancy and support
  Technical Director    contracts for Catalyst, DBIx::Class and BAST. Contact
Shadowcat Systems Ltd.  mst (at) shadowcatsystems.co.uk for more information

 + Help us build a better perl ORM: http://dbix-class.shadowcatsystems.co.uk/ +




More information about the ClassDBI mailing list