[Dbix-class] Re: Support for inline where (left join with extra condition)

Peter Rabbitson rabbit+dbic at rabbit.us
Fri Mar 15 16:24:19 GMT 2013


On Thu, Mar 14, 2013 at 12:13:17AM +0000, brew wrote:
> Yes that is a good improvement, thanks.
> 
> For my case I would need the year to be a bind variable which
> doesn't look like it is possible

The "proper" way to do this will come at some point (frew: poke poke), 
it just isn't as easy as it seems on the surface. However there are two 
workarounds for what you want to do currently:

*) The coderef is just that - a coderef. Have it refer to some external 
variable that you local()ize when you need it, and have it throw if you 
did not set a value when you had to.

*) Use the 'bind' $rs attribute (which is really from_bind_postamble) as 
described here: https://colinnewell.wordpress.com/2013/02/14/adhoc-parameters-to-joins-in-dbixclass/

Cheers



More information about the DBIx-Class mailing list