Re: Columns substitution?
[prev]
[thread]
[next]
[Date index for 2005/05/27]
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)
|