[Dbix-class] Getting numeric columns as numeric values
Peter Rabbitson
rabbit+dbic at rabbit.us
Thu Feb 26 13:32:45 GMT 2015
On 02/26/2015 12:30 AM, Augustus Saunders wrote:
> Seems a little backwards to create a helper to work around a core defect. This is something that should work transparently, and is very simple to do so.
You are correct in your overall diagnosis, you are incorrect wrt the
detail and the solution.
The problem is that DBIC "touches" some of the values returned from the
DBD (even something as innocuous as $something->{$column_value} is
enough to break the assumptions of a naive serializer).
The solution is to eliminate all these instances, and definitively not
introducing expensive operations on every single value retrieval. Some
work has been planned for this, but an audit of all code paths is
decidedly not an easy task (and having an incomplete fix in this case is
worse than not having any at all).
For the time being if you need proper *dependable* numeric semantics you
should use the ::Row::NumifyGet helper as suggested, until its
documentation is updated with 'DBIC now does this automatically'.
Cheers
More information about the DBIx-Class
mailing list