[Dbix-class] Getting numeric columns as numeric values

Peter Rabbitson rabbit+dbic at rabbit.us
Thu Feb 26 19:05:55 GMT 2015


On 02/26/2015 07:04 PM, Augustus Saunders wrote:
>
> The problem originates in DBI drivers

Not true for most DBDs

> In the interim, numifying when the user asks for the value seems simple.

And architecturally incorrect. Just like another 40-odd features I am 
holding because they are not good enough for general consumption of the 
*extremely wide* userbase of DBIC.

> As for performance, my understanding is that extracting the numeric part of a scalar is essentially free.

Nothing is "essentially free".

If checking to see whether a column is numeric is expensive, then that 
should be cached when the column is created/configured, and not 
recalculated when extracting values.

This has already been the case for years.

> In all fairness, anybody who cares about this probably isn't going to use a heavy ORM tool in the first place. Hell, witness the fact that most of the database drivers haven't fixed this problem; nobody seems to care about performance *that much*.

Let's start with "I care" and... leave it at that? :)

TL;DR: Your proposed fix is not going to be merged, besides you were 
already given a non-invasive and reliable solution.

Cheers



More information about the DBIx-Class mailing list