[Dbix-class] Fw: Namespaces for own components

Matt S Trout dbix-class at trout.me.uk
Thu Mar 2 15:07:34 CET 2006


On Thu, Mar 02, 2006 at 07:38:54PM +0900, Daisuke Murase wrote:
> Matt S Trout <dbix-class at trout.me.uk> wrote:
> > I'd probably say Plugin::*, but it's really a matter of taste.
> >
> > One thing I'd politely ask is could you ask me for svn hosting in the bast
> > repo if you want to develop a DBIC add-on - keeping them all in one place
> > means we can better keep track of them, and means if I want to change something
> > I believe isn't being used externally I can do a quick recursive grep to
> > check I'm not going to screw anybody over.
> 
> Well I'd just wrote DBIx::Class::UTF8Columns that I needed.
> 
> That module forces utf8 flag on column data when get_column().
> 
>     package Artist;
>     __PACKAGE__->load_components(qw/UTF8Columns Core/);
>     __PACKAGE__->utf8_columns(qw/name description/);
> 
>     # then belows return strings with utf8 flag
>     $artist->name;
>     $artist->get_column('description');
> 
> Is there other better way to do this ?

Looks cool to me, although it would seem more logical to me to store the
utf8-ness in column_info rather than an extra piece of class data.

You may also need to override store_column to ensure that data going
into the database does so correctly.

Would you like svn space for this as an extension or would you be willing
to maintain it as part of the main dist? I think I'd prefer the latter since
this is a very lightweight extension and quite a number of people are likely
to be interested in it.

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