[Melbourne-pm] DBIx::Class inflate/deflate vs split/combined fields

Ian Macdonald ickphum at gmail.com
Thu Nov 3 18:02:35 PDT 2011


Not a Perl answer, and may not be practical depending how many examples of
this you have and/or access to db schema, but I'd be tempted to put a view
in front of the table to combine those two fields.

Ian Macdonald
Armaguard

On Fri, Nov 4, 2011 at 11:47 AM, Malcolm Herbert <melbourne-pm at mjch.net>wrote:

> What's the recommended way to deal with cases where multiple fields
> in a database record need to be combined to produce a value? How does
> one then arrange to automatically split these back into their various
> components for insert/updates?
>
> I'm thinking here of cases where a database field has a string
> representing multiple values (I didn't write this schema) in a
> key=value;key=value format and other cases where I need to combine a
> date (without timezone) and a string containing the zone name into a
> DateTime object.
>
> Ideally I'd like to deal with that with the DBIx::Class inflate/deflate
> mechanism which should make things more portable ...
>
> In the case of the multi-value field I can create a class to represent
> this easily enough and write parse/dump routines as appropriate, but
> I'm stumped on how to work with the dates, split as they are over two
> database fields ...
>
> Has anyone had to tackle this before?
>
> Regards,
> Malcolm
>
> --
> Malcolm Herbert                                This brain intentionally
> mjch at mjch.net                                                left blank
> _______________________________________________
> Melbourne-pm mailing list
> Melbourne-pm at pm.org
> http://mail.pm.org/mailman/listinfo/melbourne-pm
>



-- 
Ian Macdonald
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.pm.org/pipermail/melbourne-pm/attachments/20111104/2a254878/attachment.html>


More information about the Melbourne-pm mailing list