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

[prev] [thread] [next] [Date index for 2006/02/11]

From: Matt S Trout
Subject: Re: [CDBI] How do you get the raw db value of a column rather than inflated object
Date: 15:23 on 11 Feb 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/ +

_______________________________________________
ClassDBI mailing list
ClassDBI@xxxxx.xxxxxxxxxxxxxxxx.xxx
http://lists.digitalcraftsmen.net/mailman/listinfo/classdbi

(message missing)

Re: [CDBI] How do you get the raw db value of a column rather than inflated object
Matt S Trout 15:23 on 11 Feb 2006

Generated at 10:41 on 18 Feb 2006 by mariachi v0.52