You are viewing a plain text version of this content. The canonical link for it is here.
Posted to embperl@perl.apache.org by Angus Lees <gu...@switchonline.com.au> on 2002/02/19 03:15:42 UTC

DBIx::Recordset Fields as an array (patch)

i was trying to do '!Fields' => 'function(foo, bar) AS baz', which
confused DBIx::Recordset->BuildFields, since it does (basically) a
split on /,/.

So i patched it to take !Fields as an array ref, in which case it assumes
you have already separated the fields appropriately.

only seen light testing, but seems ok so far.


this patch also fixes a bug with duplicate Link destinations, where it
would take the NameFields from one Link and the table join criteria
from another (now it takes them both from the first Link encountered).

fixed a "$Fields" typo in the documentation, which (iirc) has already
caught someone out.

adjusted some logic when building LinkName=2 versions of fields. now
skips if NameFields is [] (which can happen with duplicate Link
destinations).

also added a hefty debug output block to BuildFields (if Debug > 3).
i found it invaluable while working through these things, feel free
to remove it if you don't like it.


its all still in the one patch, but should be immediately obvious what
fixes what. i apologise if it isn't.

-- 
 - Gus

Re: DBIx::Recordset Fields as an array (patch)

Posted by Gerald Richter <ri...@ecos.de>.
> i was trying to do '!Fields' => 'function(foo, bar) AS baz', which
> confused DBIx::Recordset->BuildFields, since it does (basically) a
> split on /,/.
>
> So i patched it to take !Fields as an array ref, in which case it assumes
> you have already separated the fields appropriately.
>

That's a good thing to do :-)

>...
>
> its all still in the one patch, but should be immediately obvious what
> fixes what. i apologise if it isn't.
>

Thanks very much for the patches, I have the feeling that the next Recordset
version will consits to 50% out of your patches :-)

Gerald

-------------------------------------------------------------
Gerald Richter    ecos electronic communication services gmbh
Internetconnect * Webserver/-design/-datenbanken * Consulting

Post:       Tulpenstrasse 5         D-55276 Dienheim b. Mainz
E-Mail:     richter@ecos.de         Voice:    +49 6133 925131
WWW:        http://www.ecos.de      Fax:      +49 6133 925152
-------------------------------------------------------------


---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org