[Dbix-class] [OT][ANNOUNCE] SQL Generation with SQL::DB
Emanuele Zeppieri
ema_zep at libero.it
Fri Sep 7 13:43:05 GMT 2007
Mark Lawrence wrote:
> On Fri Sep 07, 2007 at 11:07:26AM +0200, Emanuele Zeppieri wrote:
>
>>> ($track->length > 248) & ! ($cd->year < 1997)
>> No, I'm asking how it could be *built* by code without string
>> concatenations/interpolations.
>
> Don't forget, the operators in the above statements are not strings,
> so concatenation won't work anyway.
Well, you can build your expression as a string, then add the extra
necessary Perl statements (use's to activate the overloading,
assignements etc) and eval the resulting string.
Why not?
Not efficient nor easy, but if you build your expressions only by
evaluating them, i can't see how you can build them dinamically for
example when they contain different logical operators, without some sort
of parser (precedence and such).
You instead just overload the operators and fully rely only on the Perl
expression parser, right?
So I misunderstood before, but that's probably even more limited than
expected.
Cheers,
Emanuele.
More information about the DBIx-Class
mailing list