Re: Columns substitution?

[prev] [thread] [next] [Date index for 2005/05/27]

From: Matt S Trout
Subject: Re: Columns substitution?
Date: 12:48 on 27 May 2005
On Fri, May 27, 2005 at 08:50:53AM +0100, Tony Bowden wrote:
> On Wed, May 25, 2005 at 04:14:09PM -0700, Lonely Rolling Star wrote:
> > I've added this to transform_sql:
> > $sql =~ s/__COLUMNS\((.*?)\)__/join ", ", map "$_", $self->columns($1)/eg;
> > Which makes __COLUMNS(Foo)__ expand to the list of columns defined 
> > earlier by __PACKAGE__->columns(Foo => ...)
> > Thoughts? Did I miss an easy way to do this?
> 
> Looks good.
> 
> You should write it up on the wiki so that other people can use it now, but
> if you can dress it up with tests etc then I'll don't see any reason
> not to add it to the next release.

Something I've been pondering - there've been a few times where people have
made interesting tweaks to Class::DBI via changing transform_sql; is it
worthwile breaking it out so that the transforms are "registered" with
Class::DBI somehow - thus giving people a plugin API for adding their
own mods to it without having to patch CDBI / overload the whole of
transform_sql?

If you think it'd be good, I can draft up a patch when I have a mo.

        -- 
             Matt S Trout           Website: http://www.shadowcatsystems.co.uk
  Technical Director        E-mail:  mst (at) shadowcatsystems.co.uk
Shadowcat Systems Ltd.

(message missing)

Columns substitution?
Lonely Rolling Star 23:14 on 25 May 2005

Re: Columns substitution?
Tony Bowden 07:50 on 27 May 2005

Re: Columns substitution?
Matt S Trout 12:48 on 27 May 2005

Re: Columns substitution?
Tony Bowden 12:53 on 27 May 2005

Re: Columns substitution?
Aaron Trevena 13:19 on 28 May 2005

Re: Columns substitution?
Tony Bowden 15:39 on 28 May 2005

Re: Columns substitution?
Aaron Trevena 16:45 on 28 May 2005

Re: Columns substitution?
Tony Bowden 20:47 on 28 May 2005

Generated at 20:11 on 05 Jun 2005 by mariachi v0.52