[Dbix-class] Column Metadata

Brandon Black blblack at gmail.com
Thu Nov 2 16:13:22 GMT 2006

On 11/2/06, Christopher H. Laco <claco at chrislaco.com> wrote:

> I would say this is the proper separation. Things in column_info should
> be restricted to describing what the field _is_, not what it _does_ or
> where it's used. So, stick to DB meta information..sizes, types,
> defaults, nullable, primary, etc.

I still think its a great place to put meta-info that goes beyond what the
DB traditionally knows.  For example, in one of my DBIC apps, I had two data
types called "Gauge" and "Percentage".  Both are stored in columns that have
the datatype "real" at the DB level.  So I have in my column_info an extra
parameter "stat_data_type" for this, to differentiate them where it
matters.  Ideally DBIC should know all of the metainfo that it can about
your data, even if the DB is incapable of representing or using some of it.
Labels are another good example.  Putting a "label =3D> 'Street Address'" in
the attributes of a column does not violate any kind of separation.  That
label can be re-used in a command-line setting as easily as a web setting,
it is universal in that sense.

-- Brandon
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://jules.scsys.co.uk/pipermail/dbix-class/attachments/20061102/07f=

More information about the Dbix-class mailing list