[Dbix-class] Column Metadata

Matt S Trout dbix-class at trout.me.uk
Wed Nov 8 23:47:16 GMT 2006


Christopher H. Laco wrote:
> Matt S Trout wrote:
>> John Napiorkowski wrote:
>>> Hi,
>>>
>>> Right now if I stuff extra things into the column
>>> metadata info like so:
>>>
>>> __PACKAGE__->add_columns(
>>>   "thumbnail_path",
>>>   {
>>>     data_type => "VARCHAR",     default_value => "",
>>>     is_nullable => 0,     size => 255,
>>>     label => "Thumbnail Path",
>>>     field_type=>"Textfield",
>>>  },
>>>
>>> I can retrieve that via the result_source column info
>>> method.  My question is do people think me putting my
>>> metadata here is a bad idea, in the sense that in some
>>> future revision of DBIx the metadata will have some
>>> sort of enforcement and won't support my arbitrary key
>>> values anymore?
>> It was designed for you to do that.
>>
>> We've got production code all over the place that uses it and I've
>> suggested it to a lot of people before now so I think I'd be summarily
>> executed by clients and users if I ever let it get broken :)
>>
> 
> recommended how...
> meta info describing what the column/data is...
> or meta info about how to use the column in presentation?

Where did I say "recommended" ?

This was a simple case of I had absolutely fuck all idea what people would 
want/need to store in there so I made it a plain hash so the answer was 
"whatever you want". As for what's a good idea or not, ask me when I don't 
have a sinus headache :)

-- 
      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