[Dbix-class] add_column oddness - what am I missing ? (a newbiequestion)]

Richard Robinson catalyst at beulah.qualmograph.org.uk
Mon Jun 18 01:24:49 GMT 2007


On Sat, Jun 16, 2007 at 05:35:37PM +0000, Frank Speiser wrote:
>
> The answer to this is actually a non-technical solution. You'd really be
> doing yourself a favor is you make those variable key-pairs fit into a
> generic table and then add a mapping table for the various keys.  Then
> when you look one up, use dbic to join your generic table to the map and
> you'll be fine. The bottom line is to abstract it enough so you don't need
> a column for each key.  I know that's not specifically the question you
> asked, but that's probably the answer you'll need - be it now or a few
> weeks and new curse words later. ;)

Beyond the short term, I'm sure you're right (_in_ the short term, it's been
a useful bodge. That doesn't mean I'm going to defend it).

But isn't the question worth asking anyway, regardless of how I arrived at
it ? Would it be naive of me to suggest that there must be 'legitimate'
(well-designed) uses for add_column(), or it wouldn't exist ?

-- 
Richard Robinson
"The whole plan hinged upon the natural curiosity of potatoes" - S. Lem




More information about the Dbix-class mailing list