[Dbix-class] get_columns() with inflaters

Matt S Trout dbix-class at trout.me.uk
Wed Mar 29 23:44:30 CEST 2006


Christopher H. Laco wrote:
> Matt S Trout wrote:
>> Michele Beltrame wrote:
>>> Hi!
>>>
>>>> my %hash = map { ($_ => $o->$_) } $o->columns;
>>> Thanks Matt, this was so easy I didn't even think of it. I don't know
>>> why, I was looking for a method which did all automatically. ;-)
>> DBIC doesn't tend to get convenience methods that encapsulate what I consider 
>> a bloody obvious perl idiom unless somebody else implements them and supplies 
>> a patch with tests. Mmm, and I turn 23 in an hour and a half. Somebody fetch 
>> me my pipe and slippers so I can sit around saying "bah" and saying how much 
>> better it was in the old days :)
>>
> 
> Bah. Kids these days have it so easy. In my day, we had Class::DBI, that
> puked and barfed up errors and we liked it! WE LOVED IT!

I remember my first ever database code. In plain DBI. Without bind parameters 
(though I did quote stuff :). And the massive fugly hashes I massaged it into. 
And the joy of learning SQL, perl, *n?x and CGI all at the same time, with a 
deadline breathing down my neck.

And later, when the code went live and suddenly had to scale, how delighted I 
was to discover "GROUP BY" :)

-- 
      Matt S Trout       Offering custom development, consultancy and support
   Technical Director    contracts for Catalyst, DBIx::Class and BAST. Contact
Shadowcat Systems Ltd.  mst (at) shadowcatsystems.co.uk for more information

+ Help us build a better perl ORM: http://dbix-class.shadowcatsystems.co.uk/ +



More information about the Dbix-class mailing list