fREWdiculous!
7 Feb
A new release of the resplendent Perl ORM DBIx::Class means new release of DBIx::Class::Helpers
The ResultSet::Random helper had the wrong function used for MySQL. That was fixed thanks to an RT from pldoh.
get_namespace_parts from the util package was unnecessarily strict. Thanks to melo for the prodding to do that.
I refactored some of the code in core DBIx::Class so that I can more easily detect is_numeric with Row::NumifyGet, instead of requiring the user to specify it. Normally DBIx::Class autodetects it based on column type, but that code wasn’t quite generic enough until now. Nice!
And then the most exciting bit is a new helper entirely for the suite: Row::ToJSON. Basically I was sick of doing this:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
Of course that can be shortened to:
But I still have to make that stupid columns list! This shiny new helper makes a TO_JSON method that will simply include all of your columns except for the “heavy” ones like TEXT, NTEXT, or BLOB. Of course you can have finer-grained control than that by explicitly saying to include (or not) a column in it’s configuration. See the docs for all the nitty gritty details.