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

Malcolm Herbert melbourne-pm at mjch.net
Thu Nov 3 17:47:57 PDT 2011


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


More information about the Melbourne-pm mailing list