[Dbix-class] Storable freeze/thaw on a column?

Ash Berlin ash at cpan.org
Sun Nov 26 13:23:09 GMT 2006


Mike Friedman wrote:
> Greetings,
> 
> I'm looking at the docs for DBIx::Class::Serialize::Storable ( 
> http://search.cpan.org/~bricas/DBIx-Class-0.07003/lib/DBIx/Class/Serialize/Storable.pm 
> <http://search.cpan.org/~bricas/DBIx-Class-0.07003/lib/DBIx/Class/Serialize/Storable.pm> 
> )
> 
> The Synopsis refers to some mysterious thing called $cache; what is 
> that? All I want to do is automatically freeze and thaw a Storable blob 
> in one column of a table. I gather I need to write a pair of methods to 
> hook STORABLE_freeze and STORABLE_thaw, but I can't seem to find out how 
> to write these or what parameters to expect, etc.
> 
> Any help will be rewarded with a doc patch. :)
> 
> Thanks,
> 
> Mike
> 
> 
> P.S. What exactly is the difference between D::C::Serialize and 
> D::C::InflateColumn? For example, I noticed 
> D::C::InflateColumn::DateTime which I'm planning to use also and which 
> seems to do roughly the same thing, except for DateTime objects instead 
> of Storable.
> 
> 

Serialize::Storable is for the Storable module to serialize entire 
DBIx::Class objects into a format suitable for use on disk/IPC. See 
Storable for more info on this. So not what you want at all - don't 
worry about a doc patch to clarify this as this module will be removed 
before next release.

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.

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.

Ash



More information about the Dbix-class mailing list