Except it won't for much longer, as we're making the values to/from inflate/deflate insist on being blessed() objects.

Though I'm pretty sure one of them did already, so do freeze/thaw return objects, or something?

Jess

On Sun, 26 Nov 2006, Mike Friedman wrote:

On 11/26/06, Ash Berlin <[EMAIL PROTECTED]> wrote:

 InflateColumn is for going to/from an object for a given column. I.e.
 turn datetime column into a DateTime object on read, and from DateTime
 object to datetime column (str value) on write.



Ah, OK. That makes sense.

However for blobs I was under the impression that it would Just Work.
 i.e. you'd get a scalar value with your data in.



Unfortunately, I wasn't able to get it to Just Work; passing a reference to
a blob column mutator just causes the stringification to be stored in the
column. But after looking at the docs for InflateColumn, I was able to get
this to work:

use Storable qw(freeze thaw);

__PACKAGE__->inflate_column(
   myblobcol => {
       inflate   => sub { thaw( shift ) },
       deflate   => sub { freeze( shift ) }
  }
);


Most excellent!

Thanks,


Mike



_______________________________________________
List: http://lists.rawmode.org/cgi-bin/mailman/listinfo/dbix-class
Wiki: http://dbix-class.shadowcatsystems.co.uk/
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/trunk/DBIx-Class/
Searchable Archive: http://www.mail-archive.com/[email protected]/

Reply via email to