[Dbix-class] Inflation and Deflation

fREW Schmidt frioux at gmail.com
Wed Jun 10 21:49:51 GMT 2009


On Mon, Jun 8, 2009 at 4:52 PM, Jose Luis Martinez <
jlmartinez-lists-dbix at capside.com> wrote:

> Hi,
>
>  I've uploaded DBIx-Class-Inflator-Serializers to CPAN (
> http://search.cpan.org/~jlmartin/DBIx-Class-Inflator-Serializers-0.01/<ht=
tp://search.cpan.org/%7Ejlmartin/DBIx-Class-Inflator-Serializers-0.01/>).
> I had to write a JSON inflator/deflator for a project, and thought that it
> would be nice to have the inflators pre-packaged. The intention is to
> provide a suite of well proven and reusable inflators and deflators to
> complement DBIx::Class.
>
> What's been improved over the inflators in the FAQ:
>
>  - If the column definition has a size attribute, and the serialized data
> structure is longer than the size: an exception is thrown.
>  - Deserialization errors throw an exception when there is an error for a=
ll
> modules (this can happen if you don't specify size and your DB truncates =
the
> value when it gets stored. Also not all deserialzation modules throw
> exceptions on error).
>  - use JSON::Any (it's already required by DBIC 0.08103)
>
> Hope you like it. I'd love to get feedback from the DBIx community to get
> this package to a 1.00 state.
>

Very cool!  you may want to consider allowing the use of a TO_JSON method as
an alias to serialized.  At least for JSON stuff that's the standard.  I
will probably try this out tomorrow or the next day and I'll let you know
how it goes.


-- =

fREW Schmidt
http://blog.afoolishmanifesto.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/dbix-class/attachments/20090610/e4e=
9110b/attachment.htm


More information about the DBIx-Class mailing list